X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fada%2FMakefile.in;h=7457e2f36ae089f4ebf071d088f6342d8f4d0a4d;hb=86232b46e55cbaf14d0843a7607bd18b3622cc16;hp=a7cc267786039d0807535e16e509c1e852fef2e2;hpb=89dc5e05933bb1873036bec04b1390de496e8e3a;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in index a7cc2677860..7457e2f36ae 100644 --- a/gcc/ada/Makefile.in +++ b/gcc/ada/Makefile.in @@ -1,25 +1,25 @@ # Makefile for GNU Ada Compiler (GNAT). -# Copyright (C) 1994-2002 Free Software Foundation, Inc. +# Copyright (C) 1994-2005 Free Software Foundation, Inc. -#This file is part of GNU CC. +#This file is part of GCC. -#GNU CC is free software; you can redistribute it and/or modify +#GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 2, or (at your option) #any later version. -#GNU CC is distributed in the hope that it will be useful, +#GCC is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #You should have received a copy of the GNU General Public License -#along with GNU CC; see the file COPYING. If not, write to +#along with GCC; see the file COPYING. If not, write to #the Free Software Foundation, 59 Temple Place - Suite 330, #Boston, MA 02111-1307, USA. # The makefile built from this file lives in the language subdirectory. -# It's purpose is to provide support for: +# Its purpose is to provide support for: # # 1) recursion where necessary, and only then (building .o's), and # 2) building and debugging cc1 from the language subdirectory, and @@ -89,20 +89,14 @@ X_ADAFLAGS = T_ADAFLAGS = CC = cc -# Let the configure setting prevail only if CC hasn't been overridden -# to xgcc by the top level Makefile (in a later stage of bootstrap). -ifeq ($(findstring xgcc, $(CC)),) -ADAC = @ADAC@ -else -ADAC = $(CC) -endif - BISON = bison BISONFLAGS = ECHO = echo LEX = flex LEXFLAGS = CHMOD = chmod +LN = ln +LN_S = ln -s CP = cp -p MV = mv -f RM = rm -f @@ -110,23 +104,23 @@ RMDIR = rm -rf MKDIR = mkdir -p AR = ar AR_FLAGS = rc -# How to invoke ranlib. -RANLIB = ranlib -# Test to use to see whether ranlib exists on the system. -RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] +LS = ls +RANLIB = @RANLIB@ +RANLIB_FLAGS = @ranlib_flags@ + SHELL = @SHELL@ -PWD = $${PWDCMD-pwd} +PWD_COMMAND = $${PWDCMD-pwd} # How to copy preserving the date INSTALL_DATA_DATE = cp -p MAKEINFO = makeinfo TEXI2DVI = texi2dvi -GNATBIND = $(STAGE_PREFIX)gnatbind -C +GNATBIND = $(STAGE_PREFIX)gnatbind GNATBIND_FLAGS = -static -x ADA_CFLAGS = ADAFLAGS = -W -Wall -gnatpg -gnata SOME_ADAFLAGS =-gnata FORCE_DEBUG_ADAFLAGS = -g -GNATLIBFLAGS = -gnatpg +GNATLIBFLAGS = -gnatpg -nostdinc GNATLIBCFLAGS = -g -O2 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \ -DIN_RTS @@ -139,21 +133,15 @@ THREAD_KIND = native THREADSLIB = GMEM_LIB = MISCLIB = +SYMDEPS = $(LIBINTL_DEP) +OUTPUT_OPTION = @OUTPUT_OPTION@ objext = .o exeext = arext = .a soext = .so shext = - -HOST_CC=$(CC) -HOST_CFLAGS=$(ALL_CFLAGS) -HOST_CLIB=$(CLIB) -HOST_LDFLAGS=$(LDFLAGS) -HOST_CPPFLAGS=$(ALL_CPPFLAGS) -HOST_ALLOCA=$(ALLOCA) -HOST_MALLOC=$(MALLOC) -HOST_OBSTACK=$(OBSTACK) +hyphen = - # Define this as & to perform parallel make on a Sequent. # Note that this has some bugs, and it seems currently necessary @@ -175,54 +163,63 @@ GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) program_transform_name = objdir = . -target=@target@ target_alias=@target_alias@ -xmake_file=@dep_host_xmake_file@ -tmake_file=@dep_tmake_file@ -host_canonical=@host_canonical@ +target=@target@ +xmake_file = @xmake_file@ +tmake_file = @tmake_file@ +host_canonical=@host@ #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c` #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c` # Directory where sources are, from where we are. srcdir = @srcdir@ -VPATH = @srcdir@ +VPATH = $(srcdir) -fsrcdir := $(shell cd $(srcdir);${PWD}) -fsrcpfx := $(shell cd $(srcdir);${PWD})/ -fcurdir := $(shell ${PWD}) -fcurpfx := $(shell ${PWD})/ +fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND}) +fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/ +fcurdir := $(shell ${PWD_COMMAND}) +fcurpfx := $(shell ${PWD_COMMAND})/ # Top build directory, relative to here. -top_builddir = .. +top_builddir = ../.. # Internationalization library. -INTLLIBS = @INTLLIBS@ -INTLDEPS = @INTLDEPS@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ # Any system libraries needed just for GNAT. SYSLIBS = @GNAT_LIBEXC@ # List of extra object files linked in with various programs. -EXTRA_GNATTOOLS_OBJS = ../prefix.o +EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o + +# List of target dependent sources, overridden below as necessary +TARGET_ADA_SRCS = -# List extra gnattools -EXTRA_GNATTOOLS = +# Type of tools build we are doing; default is not compiling tools. +TOOLSCASE = # End of variables for you to override. -# Definition of `all' is here so that new rules inserted by sed -# do not specify the default target. all: all.indirect # This tells GNU Make version 3 not to put all variables in the environment. .NOEXPORT: -# sed inserts variable overrides after the following line. -####target overrides -@target_overrides@ +# tmake_file and xmake_file expand to lists with entries of the form +# $(srcdir)/config/... but here $(srcdir) is the ada subdirectory so we +# need to adjust the paths. There can't be spaces in the subst arguments +# or we get spurious spaces in the actual list of files to include. -####host overrides -@host_overrides@ +# target overrides +ifneq ($(tmake_file),) +include $(subst /config,/../config,$(tmake_file)) +endif + +# host overrides +ifneq ($(xmake_file),) +include $(subst /config,/../config,$(xmake_file)) +endif # Now figure out from those variables how to compile and link. @@ -246,10 +243,9 @@ LIBIBERTY = ../../libiberty/libiberty.a # How to link with both our special library facilities # and the system's installed libraries. -LIBS = $(INTLLIBS) $(LIBIBERTY) $(SYSLIBS) -LIBDEPS = $(INTLDEPS) $(LIBIBERTY) -TOOLS_LIBS = ../../prefix.o $(LIBGNAT) ../../../libiberty/libiberty.a \ - $(SYSLIBS) +LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS) +LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY) +TOOLS_LIBS = $(LIBGNAT) $(EXTRA_GNATTOOLS_OBJS) link.o ../../../libiberty/libiberty.a $(SYSLIBS) # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, @@ -260,23 +256,36 @@ INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \ ADA_INCLUDES = -I- -I. -I$(srcdir) -INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) \ - -I$(fsrcdir)/.. -I$(fsrcdir)/../config -I$(fsrcdir)/../../include +INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \ + -I$(fsrcdir)/../../include -I$(fsrcdir)/.. ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir) # Avoid a lot of time thinking about remaking Makefile.in and *.def. .SUFFIXES: .in .def # Say how to compile Ada programs. -.SUFFIXES: .ada .adb .ads +.SUFFIXES: .ada .adb .ads .asm # Always use -I$(srcdir)/config when compiling. +.asm.o: + $(CC) -c -x assembler $< $(OUTPUT_OPTION) + .c.o: - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ + $(OUTPUT_OPTION) + .adb.o: - $(ADAC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< + $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) + .ads.o: - $(ADAC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< + $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) + +# how to regenerate this file +Makefile: ../config.status $(srcdir)/Makefile.in $(srcdir)/../version.c + cd ..; \ + LANGUAGES="$(CONFIG_LANGUAGES)" \ + CONFIG_HEADERS= \ + CONFIG_FILES=ada/Makefile $(SHELL) config.status # This tells GNU make version 3 not to export all the variables # defined in this file into the environment. @@ -284,25 +293,27 @@ ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir) # Lists of files for various purposes. -# Object files for gnat executables -GNATLINK_OBJS = gnatlink.o link.o \ - ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o \ - hostparm.o namet.o opt.o osint.o output.o rident.o sdefault.o stylesw.o \ - switch.o table.o tree_io.o types.o validsw.o widechar.o - -GNATMAKE_OBJS = ali.o ali-util.o \ - alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o einfo.o elists.o \ - errout.o fmap.o fname.o fname-uf.o fname-sf.o \ - gnatmake.o gnatvsn.o hostparm.o krunch.o lib.o make.o makeusg.o \ - mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \ +GNATLINK_OBJS = gnatlink.o \ + a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o \ + hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o osint.o output.o rident.o \ + s-exctab.o s-secsta.o s-stalib.o s-stoele.o sdefault.o stylesw.o switch.o system.o \ + table.o tree_io.o types.o validsw.o widechar.o + +GNATMAKE_OBJS = a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o \ + alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\ + erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \ + gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \ + make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \ namet.o nlists.o opt.o osint.o osint-m.o output.o \ - prj.o prj-attr.o prj-com.o prj-dect.o prj-env.o prj-ext.o prj-nmsc.o \ + prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \ prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \ - rident.o scans.o scn.o sdefault.o sfn_scan.o sinfo.o sinfo-cn.o \ - sinput.o sinput-l.o sinput-p.o \ - snames.o stand.o stringt.o style.o stylesw.o validsw.o switch.o switch-m.o \ - switch-c.o table.o targparm.o tree_io.o types.o \ - uintp.o uname.o urealp.o usage.o widechar.o + rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \ + scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \ + sinfo.o sinput.o sinput-c.o sinput-p.o \ + snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \ + table.o targparm.o tempdir.o tree_io.o types.o \ + uintp.o uname.o urealp.o usage.o widechar.o \ + $(EXTRA_GNATMAKE_OBJS) # Convert the target variable into a space separated list of architecture, # manufacturer, and operating system and assign each of those to its own @@ -327,13 +338,13 @@ endif # Non-tasking case: LIBGNAT_TARGET_PAIRS = \ -a-intnam.ads<4nintnam.ads \ -s-inmaop.adb<5ninmaop.adb \ -s-intman.adb<5nintman.adb \ -s-osinte.ads<5nosinte.ads \ -s-osprim.adb<7sosprim.adb \ -s-taprop.adb<5ntaprop.adb \ -s-taspri.ads<5ntaspri.ads +a-intnam.ads rts/tconfig.h - $(MAKE) -C rts CC="../../xgcc -B../../" \ + $(MAKE) -C rts \ + CC="`echo \"$(GCC_FOR_TARGET)\" \ + | sed -e 's^./xgcc^../../xgcc^' -e 's^-B./^-B../../^'`" \ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \ CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \ srcdir=$(fsrcdir) \ - -f ../Makefile $(LIBGNAT_OBJS) prefix.o - $(MAKE) -C rts CC="../../xgcc -B../../" \ - ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \ - CFLAGS="$(GNATLIBCFLAGS)" ADA_CFLAGS="$(GNATLIBCFLAGS)" \ + -f ../Makefile $(LIBGNAT_OBJS) + $(MAKE) -C rts \ + CC="`echo \"$(GCC_FOR_TARGET)\" \ + | sed -e 's^\./xgcc^../../xgcc^' -e 's^-B./^-B../../^'`" \ + ADA_INCLUDES="" \ + CFLAGS="$(GNATLIBCFLAGS)" \ ADAFLAGS="$(GNATLIBFLAGS)" \ - srcdir=$(fsrcdir) VPATH=$(fsrcdir) \ + srcdir=$(fsrcdir) \ -f ../Makefile \ $(GNATRTL_OBJS) $(RM) rts/libgnat$(arext) rts/libgnarl$(arext) $(AR) $(AR_FLAGS) rts/libgnat$(arext) \ - $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) prefix.o) - if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnat$(arext); else true; fi + $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS)) + ifneq ($(PREFIX_OBJS),) + $(AR) $(AR_FLAGS) rts/libgccprefix$(arext) $(PREFIX_OBJS); + -$(RANLIB) rts/libgccprefix$(arext) + endif + -$(RANLIB) $(RANLIB_FLAGS) rts/libgnat$(arext) $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \ $(addprefix rts/,$(GNATRTL_TASKING_OBJS)) - if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnarl$(arext); else true; fi + -$(RANLIB) $(RANLIB_FLAGS) rts/libgnarl$(arext) ifeq ($(GMEM_LIB),gmemlib) - $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o; + $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o + -$(RANLIB) $(RANLIB_FLAGS) rts/libgmem$(arext) endif $(CHMOD) a-wx rts/*.ali touch ../stamp-gnatlib -HIE_NONE_TARGET_PAIRS=\ - a-except.ads<1aexcept.ads \ - a-except.adb<1aexcept.adb \ - a-tags.adb<1atags.adb \ - s-secsta.ads<1ssecsta.ads \ - s-secsta.adb<1ssecsta.adb \ - i-c.ads<1ic.ads - -HIE_SUBST:='s/High_Integrity_Mode.*/High_Integrity_Mode : constant Boolean := True;/' -# This target needs RTS_NAME, RTS_SRCS, RTS_TARGET_PAIRS to be set properly -# it creates a rts with the proper structure and the right target dependent srcs -prepare-rts: - $(RMDIR) rts-$(RTS_NAME) - $(MKDIR) rts-$(RTS_NAME) - $(CHMOD) u+w rts-$(RTS_NAME) - $(MKDIR) rts-$(RTS_NAME)/adalib - $(MKDIR) rts-$(RTS_NAME)/adainclude - $(CHMOD) u+w rts-$(RTS_NAME)/* - $(LN) $(fsrcpfx)$(RTS_NAME).gpr rts-$(RTS_NAME) -# Copy target independent sources - $(foreach f,$(RTS_SRCS), \ - $(LN) $(fsrcpfx)$(f) rts-$(RTS_NAME)/adainclude ;) true -# Remove files to be replaced by target dependent sources - $(RM) $(foreach PAIR,$(RTS_TARGET_PAIRS), \ - rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)))) -# Copy new target dependent sources - $(foreach PAIR,$(RTS_TARGET_PAIRS), \ - $(LN) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \ - rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)));) -# change system.High_Integrity_Mode to true for the none & ravenscar rts - ifeq ($(filter-out none ravenscar,$(RTS_NAME)),) - sed -e $(HIE_SUBST) rts-$(RTS_NAME)/adainclude/system.ads \ - > dummy - $(MV) dummy rts-$(RTS_NAME)/adainclude/system.ads - endif - -install-rts: force - $(CP) -r rts-$(RTS_NAME) $(libsubdir)/ - -rts-none: force - $(MAKE) $(FLAGS_TO_PASS) prepare-rts \ - RTS_NAME=none RTS_SRCS="$(HIE_SOURCES)" \ - RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" - -$(GNATMAKE) -Prts-none/none.gpr - $(RM) rts-none/adalib/*.o - $(CHMOD) a-wx rts-none/adalib/*.ali - -rts-ravenscar: force - $(MAKE) $(FLAGS_TO_PASS) prepare-rts \ - RTS_NAME=ravenscar RTS_SRCS="$(RAVEN_SOURCES)" \ - RTS_TARGET_PAIRS="$(HIE_RAVEN_TARGET_PAIRS)" - -$(GNATMAKE) -Prts-ravenscar/none.gpr - $(CHMOD) a-wx rts-ravenscar/adalib/*.ali - -internal-hielib: ../stamp-gnatlib1 - sed -e 's/High_Integrity_Mode.*/High_Integrity_Mode : constant Boolean := True;/' rts/system.ads > rts/s.ads - $(MV) rts/s.ads rts/system.ads - $(MAKE) -C rts CC="../../xgcc -B../../" \ - ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \ - CFLAGS="$(GNATLIBCFLAGS)" \ - ADAFLAGS="$(GNATLIBFLAGS)" \ - srcdir=$(fsrcdir) VPATH=$(fsrcdir) \ - -f ../Makefile \ - $(HIE_OBJS) - $(CHMOD) a-wx rts/*.ali - $(RM) $(addprefix rts/,$(HIE_OBJS)) - touch ../stamp-gnatlib - -hielib: - $(MAKE) ADA_INCLUDE_SRCS="$(HIE_SOURCES)" LIBGNAT_SRCS="" \ - LIBGNAT_TARGET_PAIRS="a-except.ads<1aexcept.ads \ - a-except.adb<1aexcept.adb \ - a-tags.adb<1atags.adb \ - s-secsta.ads<1ssecsta.ads \ - s-secsta.adb<1ssecsta.adb \ - i-c.ads<1ic.ads" internal-hielib - -internal-ravenlib: ../stamp-gnatlib1 - sed -e 's/High_Integrity_Mode.*/High_Integrity_Mode : constant Boolean := True;/' rts/system.ads > rts/s.ads - $(MV) rts/s.ads rts/system.ads - $(MAKE) -C rts CC="../../xgcc -B../../" \ - ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \ - CFLAGS="$(GNATLIBCFLAGS)" \ - ADAFLAGS="$(GNATLIBFLAGS)" \ - srcdir=$(fsrcdir) VPATH=$(fsrcdir) \ - -f ../Makefile \ - $(RAVEN_OBJS) - $(CHMOD) a-wx rts/*.ali - touch ../stamp-gnatlib - -# Target for building a ravenscar run time for VxWorks/Cert PPC -ravenppclib: - $(MAKE) ADA_INCLUDE_SRCS="$(RAVEN_SOURCES)" LIBGNAT_SRCS="" \ - LIBGNAT_TARGET_PAIRS="a-except.ads<1aexcept.ads \ - a-except.adb<1aexcept.adb \ - a-tags.adb<1atags.adb \ - s-secsta.ads<1ssecsta.ads \ - s-secsta.adb<1ssecsta.adb \ - i-c.ads<1ic.ads \ - a-reatim.ads<1areatim.ads \ - a-reatim.adb<1areatim.adb \ - a-retide.adb<1aretide.adb \ - a-interr.adb<1ainterr.adb \ - s-interr.ads<1sinterr.ads \ - s-interr.adb<1sinterr.adb \ - s-taskin.ads<1staskin.ads \ - s-taskin.adb<1staskin.adb \ - s-tarest.adb<1starest.adb \ - s-tposen.ads<1stposen.ads \ - s-tposen.adb<1stposen.adb \ - s-osinte.adb<1sosinte.adb \ - s-taprop.ads<1staprop.ads \ - s-taprop.adb<1staprop.adb \ - a-sytaco.ads<1asytaco.ads \ - a-sytaco.adb<1asytaco.adb \ - a-intnam.ads<4zintnam.ads \ - s-osinte.adb<5zosinte.adb \ - s-osinte.ads<5zosinte.ads \ - s-taspri.ads<5ztaspri.ads \ - s-vxwork.ads<5pvxwork.ads \ - system.ads<5ysystem.ads" internal-ravenlib - # Warning: this target assumes that LIBRARY_VERSION has been set correctly. gnatlib-shared-default: $(MAKE) $(FLAGS_TO_PASS) \ @@ -1946,32 +1777,97 @@ gnatlib-shared-default: GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \ THREAD_KIND="$(THREAD_KIND)" \ gnatlib - $(RM) rts/libgnat$(soext) rts/libgnarl$(soext) - cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ - -o libgnat-$(LIBRARY_VERSION)$(soext) \ + $(RM) rts/libgna*$(soext) + cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \ + $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ - $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB) -lm - cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ - -o libgnarl-$(LIBRARY_VERSION)$(soext) \ + $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(MISCLIB) -lm + cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \ + $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(GNATRTL_TASKING_OBJS) \ - $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB) - cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext) - cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext) + $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(THREADSLIB) + cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + libgnat$(soext) + cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + libgnarl$(soext) gnatlib-shared-dual: $(MAKE) $(FLAGS_TO_PASS) \ GNATLIBFLAGS="$(GNATLIBFLAGS)" \ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ THREAD_KIND="$(THREAD_KIND)" \ + gnatlib-shared-default + $(MV) rts/libgna*$(soext) . + $(RM) ../stamp-gnatlib2 + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ + THREAD_KIND="$(THREAD_KIND)" \ gnatlib - $(MV) rts/libgnat$(arext) rts/libgnarl$(arext) . + $(MV) libgna*$(soext) rts + +gnatlib-shared-dual-win32: + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \ + THREAD_KIND="$(THREAD_KIND)" \ + gnatlib-shared-win32 + $(MV) rts/libgna*$(soext) . $(RM) ../stamp-gnatlib2 $(MAKE) $(FLAGS_TO_PASS) \ GNATLIBFLAGS="$(GNATLIBFLAGS)" \ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ THREAD_KIND="$(THREAD_KIND)" \ - gnatlib-shared-default - $(MV) libgnat$(arext) libgnarl$(arext) rts + gnatlib + $(MV) libgna*$(soext) rts + +# ??? we need to add the option to support auto-import of arrays/records to +# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will +# use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on +# Windows. +gnatlib-shared-win32: + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \ + THREAD_KIND="$(THREAD_KIND)" \ + gnatlib + $(RM) rts/libgna*$(soext) + cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ + $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB) + cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(GNATRTL_TASKING_OBJS) \ + $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) + +gnatlib-shared-darwin: + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ + -fno-common" \ + THREAD_KIND="$(THREAD_KIND)" \ + gnatlib + $(RM) rts/libgnat$(soext) rts/libgnarl$(soext) + cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ + $(SO_OPTS) \ + $(MISCLIB) -lm + cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \ + -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + $(GNATRTL_TASKING_OBJS) \ + $(SO_OPTS) \ + $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) + cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + libgnat$(soext) + cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + libgnarl$(soext) gnatlib-shared-vms: $(MAKE) $(FLAGS_TO_PASS) \ @@ -1979,23 +1875,28 @@ gnatlib-shared-vms: GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ THREAD_KIND="$(THREAD_KIND)" \ gnatlib - $(RM) rts/libgnat$(soext) rts/libgnarl$(soext) - rm -f rts/*.sym rts/gnatlib_symvec.opt - make -C rts -f ../Makefile.vms \ - $(patsubst %.obj,%.sym,$(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS)) - append /new [.rts]*.sym [.rts]gnatlib_symvec.opt - ../xgcc.exe -g -B../ -nostartfiles -shared --for-linker=/noinform \ - -o rts/libgnat.exe rts/libgnat.olb \ - --for-linker=rts/gnatlib_symvec.opt \ - --for-linker=gsmatch=equal,YY,MMDD - rm -f rts/*.sym rts/gnatlib_symvec.opt - make -C rts -f ../Makefile.vms \ - $(patsubst %.obj,%.sym,$(GNATRTL_TASKING_OBJS)) - append /new [.rts]*.sym [.rts]gnatlib_symvec.opt - ../xgcc.exe -g -B../ -nostartfiles -shared --for-linker=/noinform \ - -o rts/libgnarl.exe rts/libgnarl.olb rts/libgnat.exe \ - --for-linker=rts/gnatlib_symvec.opt \ - --for-linker=gsmatch=equal,YY,MMDD + $(RM) rts/libgna*$(soext) + cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \ + objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \ + $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \ + echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \ + ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \ + -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \ + sys\$$library:trace.exe \ + --for-linker=/noinform \ + --for-linker=SYMVEC_$$$$.opt \ + --for-linker=gsmatch=equal,$(GSMATCH_VERSION) + cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \ + objdump --syms $(GNATRTL_TASKING_OBJS) | \ + $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \ + echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \ + ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \ + -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ + libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ + sys\$$library:trace.exe \ + --for-linker=/noinform \ + --for-linker=SYMVEC_$$$$.opt \ + --for-linker=gsmatch=equal,$(GSMATCH_VERSION) gnatlib-shared: $(MAKE) $(FLAGS_TO_PASS) \ @@ -2005,82 +1906,87 @@ gnatlib-shared: TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \ $(GNATLIB_SHARED) +gnatlib-sjlj: ../stamp-gnatlib1 + sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads + $(MV) rts/s.ads rts/system.ads + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ + THREAD_KIND="$(THREAD_KIND)" \ + TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib + +gnatlib-zcx: ../stamp-gnatlib1 + sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads + $(MV) rts/s.ads rts/system.ads + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ + THREAD_KIND="$(THREAD_KIND)" \ + TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib + # .s files for cross-building gnat-cross: force - make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp" \ - HOST_CFLAGS= HOST_CC=cc + make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp" # Compiling object files from source files. -# Ada language specific files. +# Note that dependencies on obstack.h are not written +# because that file is not part of GCC. +# Dependencies on gvarargs.h are not written +# because all that file does, when not compiling with GCC, +# is include the system varargs.h. b_gnatl.c : $(GNATLINK_OBJS) - $(GNATBIND) $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali + $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali b_gnatl.o : b_gnatl.c b_gnatm.c : $(GNATMAKE_OBJS) - $(GNATBIND) $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali + $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali b_gnatm.o : b_gnatm.c +ADA_INCLUDE_DIR = $(libsubdir)/adainclude +ADA_RTL_OBJ_DIR = $(libsubdir)/adalib + +# force no sibling call optimization on s-traceb.o so the number of stack +# frames to be skipped when computing a call chain is not modified by +# optimization. However we can do that only when building the runtime +# (not the compiler) because the -fno-optimize-sibling-calls exists +# only in GCC 3. + +ifneq (,$(findstring xgcc,$(CC))) +NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls +else +NO_SIBLING_ADAFLAGS= +endif + +s-traceb.o : s-traceb.adb + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \ + $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) + # force debugging information on s-tasdeb.o so that it is always # possible to set conditional breakpoints on tasks. s-tasdeb.o : s-tasdeb.adb s-tasdeb.ads - $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) $< - -# force debugging information on s-vaflop.o so that it is always -# possible to call the VAX float debug print routines. -# force at least -O so that the inline assembly works. - -s-vaflop.o : s-vaflop.adb s-vaflop.ads - $(ADAC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \ - $(ADA_INCLUDES) $< + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) # force debugging information on a-except.o so that it is always # possible to set conditional breakpoints on exceptions. # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets. a-except.o : a-except.adb a-except.ads - $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \ - $(ADA_INCLUDES) $< + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \ + $(ADA_INCLUDES) $< $(OUTPUT_OPTION) # force debugging information on s-assert.o so that it is always # possible to set breakpoint on assert failures. s-assert.o : s-assert.adb s-assert.ads a-except.ads - $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 \ - $(ADA_INCLUDES) $< - -mdll.o : mdll.adb mdll.ads mdll-file.ads mdll-utl.ads - $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< - -mdll-fil.o : mdll-fil.adb mdll.ads mdll-fil.ads - $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< - -mdll-utl.o : mdll-utl.adb mdll.ads mdll-utl.ads sdefault.ads types.ads - $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< - -# force debugging information and no optimization on s-memory.o so that it -# is always possible to set breakpoint on __gnat_malloc and __gnat_free -# this is important for gnatmem using GDB. memtrack.o is built from -# memtrack.adb, and used by the post-mortem analysis with gnatmem. - -s-memory.o : s-memory.adb s-memory.ads memtrack.o - $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ - $(ADA_INCLUDES) $< - -memtrack.o : memtrack.adb s-memory.ads - $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ - $(ADA_INCLUDES) $< - -# Need to keep the frame pointer in this file to pop the stack properly on -# some targets. - -traceb.o : traceb.c - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \ - $< - + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) +adadecode.o : adadecode.c adadecode.h aux-io.o : aux-io.c argv.o : argv.c cal.o : cal.c @@ -2092,36 +1998,37 @@ final.o : raise.h final.c gmem.o : gmem.c link.o : link.c mkdir.o : mkdir.c +socket.o : socket.c gsocket.h sysdep.o : sysdep.c -cio.o : cio.c - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \ - $(ALL_CPPFLAGS) $(INCLUDES) $< +gen-soccon: gen-soccon.c gsocket.h + $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \ + $(ALL_CPPFLAGS) $(INCLUDES) -DTARGET=\"$(target_alias)\" \ + $< $(OUTPUT_OPTION) + +cio.o : cio.c + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \ + $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) init.o : init.c ada.h types.h raise.h - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \ - $(ALL_CPPFLAGS) $(INCLUDES) $< + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \ + $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) + +# No optimization to compile this file as optimizations (-O1 or above) breaks +# the SEH handling on Windows. The reasons are not clear. +seh_init.o : seh_init.c raise.h + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) -O0 \ + $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) raise.o : raise.c raise.h - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \ - $(ALL_CPPFLAGS) $(INCLUDES) $< + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \ + $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) # Need to keep the frame pointer in this file to pop the stack properly on # some targets. -tracebak.o : tracebak.c - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - -fno-omit-frame-pointer $< - -targtyps.o : targtyps.c $(CONFIG_H) ada.h types.h atree.h nlists.h elists.h \ - uintp.h sinfo.h einfo.h namet.h snames.h stringt.h urealp.h fe.h \ - $(ADA_TREE_H) gigi.h - -# Rule to compile prefix.o for the run-time. - -prefix.o : $(srcdir)/../prefix.c - $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \ - $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/../.. -I../.. \ - -DPREFIX=\"$(prefix)\" $< +tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c + $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + -fno-omit-frame-pointer $< $(OUTPUT_OPTION) # In GNU Make, ignore whether `stage*' exists. .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap @@ -2129,18 +2036,18 @@ prefix.o : $(srcdir)/../prefix.c force: -# Gnatlbr is only used on VMS +# Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS -GNATLBR_RTL_C_OBJS = adaint.o argv.o cio.o cstreams.o exit.o final.o init.o \ - raise.o sysdep.o tracebak.o -GNATLBR_C_OBJS = $(GNATLBR_RTL_C_OBJS) +../../gnatlbr$(exeext): ../../prefix.o + $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)" + $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr + $(GNATLINK) -v gnatlbr -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS) -../gnatlbr$(exeext):: sdefault.o $(GNATLBR_C_OBJS) $(EXTRA_GNATTOOLS_OBJS) - $(RM) $@ -../gnatlbr$(exeext):: force - $(GNATMAKE) -a --GCC="$(CC)" $(ALL_ADAFLAGS) $(ADA_INCLUDES) \ - --GNATBIND="$(GNATBIND)" --GNATLINK="$(GNATLINK)" \ - -nostdlib $(fsrcpfx)gnatlbr -o $@ \ - -largs --GCC="$(CC) $(ALL_CFLAGS) $(LDFLAGS)" \ - $(GNATLBR_C_OBJS) $(EXTRA_GNATTOOLS_OBJS) +../../vms_help$(exeext): + $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)" + $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help + $(GNATLINK) -v vms_help -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS) +../../gnat.hlp: ../../vms_help$(exeext) + ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \ + $(fsrcdir)/vms_data.ads ../../gnat.hlp