# Top level -*- makefile -*- fragment for GNU Ada (GNAT). # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 # Free Software Foundation, Inc. #This file is part of GCC. #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 3, or (at your option) #any later version. #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 GCC; see the file COPYING3. If not see #. # This file provides the language dependent support in the main Makefile. # Each language makefile fragment must provide the following targets: # # foo.all.cross, foo.start.encap, foo.rest.encap, # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf, # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall, # foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 # # where `foo' is the name of the language. # # It should also provide rules for: # # - making any compiler driver (eg: g++) # - the compiler proper (eg: cc1plus) # - define the names for selecting the language in LANGUAGES. # tool definitions CP = cp -p ECHO = echo MV = mv MKDIR = mkdir -p RM = rm -f RMDIR = rm -rf # Extra flags to pass to recursive makes. COMMON_ADAFLAGS= -gnatpg ifeq ($(TREECHECKING),) CHECKING_ADAFLAGS= else CHECKING_ADAFLAGS= -gnata endif WARN_ADAFLAGS= -W -Wall # For native builds, the base compiler might be old and we need to arrange for # style warnings not to be flagged as errors during stage1. Cross compilers # need to be built by a recent/matching native so we might as well leave the # checks fully active. ifeq ($(CROSS),) ADAFLAGS= $(COMMON_ADAFLAGS) -gnatwns else ADAFLAGS= $(COMMON_ADAFLAGS) endif ALL_ADAFLAGS = \ $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS) $(CHECKING_ADAFLAGS) $(WARN_ADAFLAGS) FORCE_DEBUG_ADAFLAGS = -g ADA_CFLAGS = ADA_INCLUDES = -nostdinc -I- -I. -Iada/generated -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc GNATLIBCFLAGS= -g -O2 $(TCFLAGS) ADA_INCLUDE_DIR = $(libsubdir)/adainclude ADA_RTL_OBJ_DIR = $(libsubdir)/adalib THREAD_KIND=native TRACE=no # We do not want the WARN_CFLAGS of the compiler in Ada as it is for C/C++. COMMON_FLAGS_TO_PASS = $(filter-out $(WARN_CFLAGS), $(FLAGS_TO_PASS)) ADA_FLAGS_TO_PASS = \ "ADA_FOR_BUILD=$(ADA_FOR_BUILD)" \ "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)" \ "ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)" \ "ADAFLAGS=$(ADAFLAGS) $(WARN_ADAFLAGS)" \ "ADA_FOR_TARGET=$(ADA_FOR_TARGET)" \ "INSTALL=$(INSTALL)" \ "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" # List of Ada tools to build and install ADA_TOOLS=gnatbind gnatchop gnat gnatkr gnatlink gnatls gnatmake \ gnatname gnatprep gnatxref gnatfind gnatclean # Say how to compile Ada programs. .SUFFIXES: .ada .adb .ads # FIXME: need to add $(ADA_CFLAGS) to .c.o suffix rule # Use mildly strict warnings for this front end and add special flags. ada-warn = $(ADA_CFLAGS) $(filter-out -pedantic, $(STRICT_WARN)) # Unresolved warnings in specific files. ada/adaint.o-warn = -Wno-error ada/%.o: ada/gcc-interface/%.c $(COMPILE) $< $(POSTCOMPILE) # Function that dumps the dependencies of an Ada object file by parsing the # associated ALI file. We match the lines starting with D to achieve that. ADA_DEPS=case $@ in \ *sdefault.o);; \ *)a="`echo $@ | sed -e 's/.o$$/.ali/'`"; \ echo "$@: `cat $$a | \ sed -ne 's;^D \([a-z0-9_\.-]*\).*;ada/\1;gp' | \ sed -e 's;ada/gnatvsn.ads;ada/generated/gnatvsn.ads;g' | \ tr -d '\015' | tr '\n' ' '`" > $(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@));; \ esac; .adb.o: $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) @$(ADA_DEPS) .ads.o: $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) @$(ADA_DEPS) # Define the names for selecting Ada in LANGUAGES. ada: gnat1$(exeext) gnatbind$(exeext) # Tell GNU Make to ignore these, if they exist. .PHONY: ada # Compute the FLAGS to pass for gnattools, now linked with a C++ driver as # we're linking against at least libcommon which contains C++ compiled code. # We need to use the same driver to link as the one that was used to produce # the objects, which depends on whether we're bootstrapping or not. The CXX # variable conveys what we need for this, set to "g++" if not bootstrapping, # ".../xg++" otherwise. # There are too many Ada sources to check against here. Let's # always force the recursive make. ifeq ($(build), $(host)) ifeq ($(host), $(target)) # This is a regular native. So use the compiler from our current build # tree. ADA_TOOLS_FLAGS_TO_PASS=\ CC="../../xgcc -B../../" \ CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I- -I../generated -I../rts" \ GNATMAKE="../../gnatmake" \ GNATLINK="../../gnatlink" \ GNATBIND="../../gnatbind" else # This is a regular cross compiler. Use the native compiler to compile # the tools. # put the host RTS dir first in the PATH to hide the default runtime # files that are among the sources ifneq ($(findstring ada,$(LANGUAGES)),) RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) endif ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I../generated -I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \ GNATMAKE="gnatmake" \ GNATBIND="gnatbind" \ GNATLINK="gnatlink" \ LIBGNAT="" endif else # Build is different from host so we are either building a canadian cross # or a cross-native compiler. We provide defaults for tools targeting the # host platform, but they can be overriden by just setting _FOR_HOST # variables. GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink GNATLS_FOR_HOST=$(host_noncanonical)-gnatls ifeq ($(host), $(target)) # This is a cross native. All the sources are taken from the currently # built runtime. ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I../generated -I../rts" \ GNATMAKE="$(GNATMAKE_FOR_HOST)" \ GNATBIND="$(GNATBIND_FOR_HOST)" \ GNATLINK="$(GNATLINK_FOR_HOST)" \ LIBGNAT="" else # This is a canadian cross. We should use a toolchain running on the # build platform and targeting the host platform. ifneq ($(findstring ada,$(LANGUAGES)),) RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib ))) endif ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I../generated -I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \ GNATMAKE="$(GNATMAKE_FOR_HOST)" \ GNATBIND="$(GNATBIND_FOR_HOST)" \ GNATLINK="$(GNATLINK_FOR_HOST)" \ LIBGNAT="" endif endif # Strip -Werror during linking for the LTO bootstrap GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) GCC_LINK=$(LINKER) $(GCC_LINKERFLAGS) $(LDFLAGS) GCC_LLINK=$(LLINKER) $(GCC_LINKERFLAGS) $(LDFLAGS) # Lists of files for various purposes. # Languages-specific object files for Ada. # Object files for gnat1 from C sources. GNAT1_C_OBJS = ada/adadecode.o ada/adaint.o ada/argv.o ada/cio.o \ ada/cstreams.o ada/env.o ada/init.o ada/initialize.o ada/raise.o \ ada/seh_init.o ada/targext.o ada/cuintp.o ada/decl.o ada/rtfinal.o \ ada/rtinit.o ada/misc.o ada/utils.o ada/utils2.o ada/trans.o ada/targtyps.o # Object files from Ada sources that are used by gnat1 GNAT_ADA_OBJS = \ ada/a-charac.o \ ada/a-chlat1.o \ ada/a-elchha.o \ ada/a-except.o \ ada/a-ioexce.o \ ada/ada.o \ ada/spark_xrefs.o \ ada/ali.o \ ada/alloc.o \ ada/aspects.o \ ada/atree.o \ ada/butil.o \ ada/casing.o \ ada/checks.o \ ada/comperr.o \ ada/contracts.o \ ada/csets.o \ ada/cstand.o \ ada/debug.o \ ada/debug_a.o \ ada/einfo.o \ ada/elists.o \ ada/err_vars.o \ ada/errout.o \ ada/erroutc.o \ ada/eval_fat.o \ ada/exp_aggr.o \ ada/exp_spark.o \ ada/exp_atag.o \ ada/exp_attr.o \ ada/exp_cg.o \ ada/exp_ch11.o \ ada/exp_ch12.o \ ada/exp_ch13.o \ ada/exp_ch2.o \ ada/exp_ch3.o \ ada/exp_ch4.o \ ada/exp_ch5.o \ ada/exp_ch6.o \ ada/exp_ch7.o \ ada/exp_ch8.o \ ada/exp_ch9.o \ ada/exp_code.o \ ada/exp_dbug.o \ ada/exp_disp.o \ ada/exp_dist.o \ ada/exp_fixd.o \ ada/exp_imgv.o \ ada/exp_intr.o \ ada/exp_pakd.o \ ada/exp_prag.o \ ada/exp_sel.o \ ada/exp_smem.o \ ada/exp_strm.o \ ada/exp_tss.o \ ada/exp_unst.o \ ada/exp_util.o \ ada/expander.o \ ada/fmap.o \ ada/fname-uf.o \ ada/fname.o \ ada/freeze.o \ ada/frontend.o \ ada/g-byorma.o \ ada/g-hesora.o \ ada/g-htable.o \ ada/g-spchge.o \ ada/g-speche.o \ ada/g-u3spch.o \ ada/get_spark_xrefs.o \ ada/get_targ.o \ ada/ghost.o \ ada/gnat.o \ ada/gnatvsn.o \ ada/hostparm.o \ ada/impunit.o \ ada/inline.o \ ada/interfac.o \ ada/itypes.o \ ada/krunch.o \ ada/layout.o \ ada/lib-load.o \ ada/lib-util.o \ ada/lib-writ.o \ ada/lib-xref.o \ ada/lib.o \ ada/live.o \ ada/namet-sp.o \ ada/namet.o \ ada/nlists.o \ ada/nmake.o \ ada/opt.o \ ada/osint-c.o \ ada/osint.o \ ada/output.o \ ada/par.o \ ada/par_sco.o \ ada/prep.o \ ada/prepcomp.o \ ada/put_spark_xrefs.o \ ada/put_scos.o \ ada/repinfo.o \ ada/restrict.o \ ada/rident.o \ ada/rtsfind.o \ ada/s-addope.o \ ada/s-assert.o \ ada/s-bitops.o \ ada/s-carun8.o \ ada/s-casuti.o \ ada/s-conca2.o \ ada/s-conca3.o \ ada/s-conca4.o \ ada/s-conca5.o \ ada/s-conca6.o \ ada/s-conca7.o \ ada/s-conca8.o \ ada/s-conca9.o \ ada/s-crc32.o \ ada/s-crtl.o \ ada/s-excdeb.o \ ada/s-except.o \ ada/s-exctab.o \ ada/s-htable.o \ ada/s-imenne.o \ ada/s-imgenu.o \ ada/s-mastop.o \ ada/s-memory.o \ ada/s-os_lib.o \ ada/s-parame.o \ ada/s-purexc.o \ ada/s-restri.o \ ada/s-secsta.o \ ada/s-soflin.o \ ada/s-sopco3.o \ ada/s-sopco4.o \ ada/s-sopco5.o \ ada/s-stache.o \ ada/s-stalib.o \ ada/s-stoele.o \ ada/s-strcom.o \ ada/s-strhas.o \ ada/s-string.o \ ada/s-strops.o \ ada/s-traent.o \ ada/s-unstyp.o \ ada/s-utf_32.o \ ada/s-valint.o \ ada/s-valuns.o \ ada/s-valuti.o \ ada/s-wchcnv.o \ ada/s-wchcon.o \ ada/s-wchjis.o \ ada/scans.o \ ada/scil_ll.o \ ada/scn.o \ ada/scng.o \ ada/scos.o \ ada/sdefault.o \ ada/sem.o \ ada/sem_aggr.o \ ada/sem_attr.o \ ada/sem_aux.o \ ada/sem_case.o \ ada/sem_cat.o \ ada/sem_ch10.o \ ada/sem_ch11.o \ ada/sem_ch12.o \ ada/sem_ch13.o \ ada/sem_ch2.o \ ada/sem_ch3.o \ ada/sem_ch4.o \ ada/sem_ch5.o \ ada/sem_ch6.o \ ada/sem_ch7.o \ ada/sem_ch8.o \ ada/sem_ch9.o \ ada/sem_dim.o \ ada/sem_disp.o \ ada/sem_dist.o \ ada/sem_elab.o \ ada/sem_elim.o \ ada/sem_eval.o \ ada/sem_intr.o \ ada/sem_mech.o \ ada/sem_prag.o \ ada/sem_res.o \ ada/sem_scil.o \ ada/sem_smem.o \ ada/sem_type.o \ ada/sem_util.o \ ada/sem_warn.o \ ada/set_targ.o \ ada/sinfo-cn.o \ ada/sinfo.o \ ada/sinput-d.o \ ada/sinput-l.o \ ada/sinput.o \ ada/snames.o \ ada/sprint.o \ ada/stand.o \ ada/stringt.o \ ada/style.o \ ada/styleg.o \ ada/stylesw.o \ ada/switch-c.o \ ada/switch.o \ ada/system.o \ ada/table.o \ ada/targparm.o \ ada/tbuild.o \ ada/tree_gen.o \ ada/tree_in.o \ ada/tree_io.o \ ada/treepr.o \ ada/treeprs.o \ ada/ttypes.o \ ada/types.o \ ada/uintp.o \ ada/uname.o \ ada/urealp.o \ ada/usage.o \ ada/validsw.o \ ada/warnsw.o \ ada/widechar.o # Object files for gnat executables GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS) ada/b_gnat1.o GNATBIND_OBJS = \ ada/a-clrefi.o \ ada/a-comlin.o \ ada/a-elchha.o \ ada/a-except.o \ ada/ada.o \ ada/adaint.o \ ada/ali-util.o \ ada/ali.o \ ada/alloc.o \ ada/argv.o \ ada/aspects.o \ ada/atree.o \ ada/bcheck.o \ ada/binde.o \ ada/binderr.o \ ada/bindgen.o \ ada/bindusg.o \ ada/butil.o \ ada/casing.o \ ada/cio.o \ ada/csets.o \ ada/cstreams.o \ ada/debug.o \ ada/einfo.o \ ada/elists.o \ ada/env.o \ ada/err_vars.o \ ada/errout.o \ ada/erroutc.o \ ada/exit.o \ ada/final.o \ ada/fmap.o \ ada/fname-uf.o \ ada/fname.o \ ada/g-byorma.o \ ada/g-hesora.o \ ada/g-htable.o \ ada/gnat.o \ ada/gnatbind.o \ ada/gnatvsn.o \ ada/hostparm.o \ ada/init.o \ ada/initialize.o \ ada/interfac.o \ ada/krunch.o \ ada/lib.o \ ada/link.o \ ada/namet.o \ ada/nlists.o \ ada/opt.o \ ada/osint-b.o \ ada/osint.o \ ada/output.o \ ada/raise.o \ ada/restrict.o \ ada/rident.o \ ada/rtfinal.o \ ada/rtinit.o \ ada/s-addope.o \ ada/s-assert.o \ ada/s-carun8.o \ ada/s-casuti.o \ ada/s-conca2.o \ ada/s-conca3.o \ ada/s-conca4.o \ ada/s-conca5.o \ ada/s-conca6.o \ ada/s-conca7.o \ ada/s-conca8.o \ ada/s-conca9.o \ ada/s-crc32.o \ ada/s-crtl.o \ ada/s-excdeb.o \ ada/s-except.o \ ada/s-exctab.o \ ada/s-htable.o \ ada/s-imenne.o \ ada/s-imgenu.o \ ada/s-mastop.o \ ada/s-memory.o \ ada/s-os_lib.o \ ada/s-parame.o \ ada/s-restri.o \ ada/s-secsta.o \ ada/s-soflin.o \ ada/s-sopco3.o \ ada/s-sopco4.o \ ada/s-sopco5.o \ ada/s-stache.o \ ada/s-stalib.o \ ada/s-stoele.o \ ada/s-strhas.o \ ada/s-string.o \ ada/s-strops.o \ ada/s-traent.o \ ada/s-unstyp.o \ ada/s-utf_32.o \ ada/s-wchcnv.o \ ada/s-wchcon.o \ ada/s-wchjis.o \ ada/scans.o \ ada/scil_ll.o \ ada/scng.o \ ada/sdefault.o \ ada/seh_init.o \ ada/sem_aux.o \ ada/sinfo.o \ ada/sinput-c.o \ ada/sinput.o \ ada/snames.o \ ada/stand.o \ ada/stringt.o \ ada/style.o \ ada/styleg.o \ ada/stylesw.o \ ada/switch-b.o \ ada/switch.o \ ada/system.o \ ada/table.o \ ada/targext.o \ ada/targparm.o \ ada/tree_io.o \ ada/types.o \ ada/uintp.o \ ada/uname.o \ ada/urealp.o \ ada/widechar.o # Language-independent object files. ADA_BACKEND = $(BACKEND) attribs.o # List of target dependent sources, overridden below as necessary TARGET_ADA_SRCS = # Needs to be built with CC=gcc # Since the RTL should be built with the latest compiler, remove the # stamp target in the parent directory whenever gnat1 is rebuilt gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target.a $(LIBDEPS) +$(GCC_LLINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) \ libcommon-target.a $(LIBS) $(SYSLIBS) $(BACKENDLIBS) $(CFLAGS) $(RM) stamp-gnatlib2-rts stamp-tools gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBDEPS) +$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBS) $(SYSLIBS) $(CFLAGS) # use target-gcc target-gnatmake target-gnatbind target-gnatlink gnattools: $(GCC_PARTS) $(CONFIG_H) prefix.o force $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2 regnattools: $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2 cross-gnattools: force $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools4 canadian-gnattools: force $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools4 gnatlib gnatlib-sjlj gnatlib-zcx gnatlib-shared: force $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) \ GNATLIBFLAGS="$(GNATLIBFLAGS)" \ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \ THREAD_KIND="$(THREAD_KIND)" \ TRACE="$(TRACE)" \ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \ $@ # use only for native compiler gnatlib_and_tools: gnatlib gnattools # Build hooks: ada.all.cross: for tool in $(ADA_TOOLS) ; do \ if [ -f $$tool$(exeext) ] ; \ then \ $(MV) $$tool$(exeext) $$tool-cross$(exeext); \ fi; \ done ada.start.encap: ada.rest.encap: ada.man: ada.srcextra: ada.srcman: ada.tags: force cd $(srcdir)/ada && etags -o TAGS.sub *.c *.h *.ads *.adb && \ etags --include TAGS.sub --include ../TAGS.sub # Generate documentation. doc/gnat_ugn.info: ada/gnat_ugn.texi \ $(gcc_docdir)/include/fdl.texi $(gcc_docdir)/include/gcc-common.texi \ gcc-vers.texi if [ x$(BUILD_INFO) = xinfo ]; then \ rm -f $(@)*; \ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \ -I$(srcdir)/ada -o $@ $<; \ else true; fi doc/gnat_rm.info: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi if [ x$(BUILD_INFO) = xinfo ]; then \ rm -f $(@)*; \ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \ -I$(srcdir)/ada -o $@ $<; \ else true; fi doc/gnat-style.info: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi if [ x$(BUILD_INFO) = xinfo ]; then \ rm -f $(@)*; \ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \ -I$(srcdir)/ada -o $@ $<; \ else true; fi ADA_INFOFILES = doc/gnat_ugn.info doc/gnat_rm.info doc/gnat-style.info ada.info: $(ADA_INFOFILES) ada.srcinfo: $(ADA_INFOFILES) -$(CP) $^ $(srcdir)/doc ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \ $(DESTDIR)$(infodir)/gnat_rm.info \ $(DESTDIR)$(infodir)/gnat-style.info ada.dvi: doc/gnat_ugn.dvi \ doc/gnat_rm.dvi doc/gnat-style.dvi ADA_PDFFILES = doc/gnat_ugn.pdf \ doc/gnat_rm.pdf doc/gnat-style.pdf ada.pdf: $(ADA_PDFFILES) ada.install-pdf: $(ADA_PDFFILES) @$(NORMAL_INSTALL) test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc" @list='$(ADA_PDFFILES)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(pdf__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \ done ada.html: ada.install-html: doc/gnat_ugn.dvi: ada/gnat_ugn.texi \ $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $< doc/gnat_rm.dvi: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $< doc/gnat-style.dvi: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $< doc/gnat_ugn.pdf: ada/gnat_ugn.texi \ $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $< doc/gnat_rm.pdf: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $< doc/gnat-style.pdf: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $< # Install hooks: # gnat1 is installed elsewhere as part of $(COMPILERS). # Install the binder program as gnatbind (native) or $(prefix)gnatbind # (cross). $(prefix) comes from the --program-prefix configure option, # or from the --target option if the former is not specified. # Do the same for the rest of the Ada tools (gnatchop, gnat, gnatkr, # gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref, gnatfind, # gnatclean). # gnatdll is only used on Windows. # vxaddr2line is only used for cross VxWorks ports (it calls the underlying # cross addr2line). ada.install-common: $(MKDIR) $(DESTDIR)$(bindir) -if [ -f gnat1$(exeext) ] ; \ then \ for tool in $(ADA_TOOLS) ; do \ install_name=`echo $$tool|sed '$(program_transform_name)'`$(exeext); \ $(RM) $(DESTDIR)$(bindir)/$$install_name; \ if [ -f $$tool-cross$(exeext) ] ; \ then \ $(INSTALL_PROGRAM) $$tool-cross$(exeext) $(DESTDIR)$(bindir)/$$install_name; \ else \ $(INSTALL_PROGRAM) $$tool$(exeext) $(DESTDIR)$(bindir)/$$install_name; \ fi ; \ done; \ $(RM) $(DESTDIR)$(bindir)/gnatdll$(exeext); \ $(INSTALL_PROGRAM) gnatdll$(exeext) $(DESTDIR)$(bindir)/gnatdll$(exeext); \ if [ -f vxaddr2line$(exeext) ] ; \ then \ $(RM) $(DESTDIR)$(bindir)/vxaddr2line$(exeext); \ $(INSTALL_PROGRAM) vxaddr2line$(exeext) $(DESTDIR)$(bindir)/vxaddr2line$(exeext); \ fi ; \ fi # # Finally, install the library # -if [ -f gnat1$(exeext) ] ; \ then \ $(MAKE) $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib; \ fi install-gnatlib: $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib$(LIBGNAT_TARGET) install-gnatlib-obj: $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib-obj ada.install-man: ada.install-plugin: ada.uninstall: for tool in $(ADA_TOOLS) ; do \ install_name=`echo $$tool|sed '$(program_transform_name)'`$(exeext); \ -$(RM) $(DESTDIR)$(bindir)/$$install_name; \ done -$(RM) $(DESTDIR)$(tooldir)/bin/gnatdll$(exeext) -$(RM) $(DESTDIR)$(tooldir)/bin/vxaddr2line$(exeext) # Clean hooks: # A lot of the ancillary files are deleted by the main makefile. # We just have to delete files specific to us. ada.mostlyclean: -$(RM) ada/*$(objext) ada/*.ali ada/b_gnat*.ads ada/b_gnat*.adb -$(RM) ada/*$(coverageexts) -$(RM) ada/sdefault.adb ada/stamp-sdefault ada/stamp-snames -$(RMDIR) ada/tools -$(RM) gnatbind$(exeext) gnat1$(exeext) ada.clean: ada.distclean: -$(RM) ada/Makefile -$(RM) gnatchop$(exeext) -$(RM) gnat$(exeext) -$(RM) gnatdll$(exeext) -$(RM) gnatkr$(exeext) -$(RM) gnatlink$(exeext) -$(RM) gnatls$(exeext) -$(RM) gnatmake$(exeext) -$(RM) gnatname$(exeext) -$(RM) gnatprep$(exeext) -$(RM) gnatfind$(exeext) -$(RM) gnatxref$(exeext) -$(RM) gnatclean$(exeext) -$(RM) ada/rts/* -$(RMDIR) ada/rts -$(RM) ada/tools/* -$(RMDIR) ada/tools ada.maintainer-clean: -$(RM) ada/sinfo.h -$(RM) ada/einfo.h -$(RM) ada/nmake.adb -$(RM) ada/nmake.ads -$(RM) ada/treeprs.ads -$(RM) ada/snames.ads ada/snames.adb ada/snames.h # Stage hooks: # The main makefile has already created stage?/ada ada.stage1: stage1-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage1/ada -$(MV) ada/stamp-* stage1/ada ada.stage2: stage2-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage2/ada -$(MV) ada/stamp-* stage2/ada ada.stage3: stage3-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage3/ada -$(MV) ada/stamp-* stage3/ada ada.stage4: stage4-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage4/ada -$(MV) ada/stamp-* stage4/ada ada.stageprofile: stageprofile-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stageprofile/ada -$(MV) ada/stamp-* stageprofile/ada ada.stagefeedback: stagefeedback-start -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stagefeedback/ada -$(MV) ada/stamp-* stagefeedback/ada lang_checks += check-gnat lang_checks_parallelized += check-gnat # For description see the check_$lang_parallelize comment in gcc/Makefile.in. check_gnat_parallelize = 1000 check-ada: check-acats check-gnat check-ada-subtargets: check-acats-subtargets check-gnat-subtargets ACATSDIR = $(TESTSUITEDIR)/ada/acats ACATSCMD = run_acats.sh check_acats_numbers0:=1 2 3 4 5 6 7 8 9 check_acats_numbers1:=0 $(check_acats_numbers0) check_acats_numbers2:=$(foreach i,$(check_acats_numbers0),$(addprefix $(i),$(check_acats_numbers1))) check_acats_numbers3:=$(addprefix 0,$(check_acats_numbers1)) $(check_acats_numbers2) check_acats_numbers4:=$(foreach i,$(check_acats_numbers0),$(addprefix $(i),$(check_acats_numbers3))) check_acats_numbers5:=$(addprefix 0,$(check_acats_numbers3)) $(check_acats_numbers4) check_acats_numbers6:=$(foreach i,$(check_acats_numbers0),$(addprefix $(i),$(check_acats_numbers5))) check_acats_numbers:=$(check_acats_numbers0) $(check_acats_numbers2) $(check_acats_numbers4) $(check_acats_numbers6) check_acats_subdirs=$(wordlist 1, \ $(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \ $(check_acats_numbers)) check_acats_targets = $(addprefix check-acats, $(check_acats_subdirs)) check-acats: @test -d $(ACATSDIR) || mkdir -p $(ACATSDIR); \ rootme=`${PWD_COMMAND}`; export rootme; \ EXPECT=$(EXPECT); export EXPECT; \ if [ -z "$(CHAPTERS)" ] && [ -n "$(filter -j%, $(MFLAGS))" ]; \ then \ rm -rf $(ACATSDIR)-parallel; \ mkdir $(ACATSDIR)-parallel; \ ( testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \ export testdir; \ cd $(ACATSDIR) && $(SHELL) $${testdir}/$(ACATSCMD) NONE ) \ || exit 1; \ GCC_RUNTEST_PARALLELIZE_DIR=$$rootme/$(ACATSDIR)-parallel; \ export GCC_RUNTEST_PARALLELIZE_DIR; \ $(MAKE) $(check_acats_targets); \ rm -rf $(ACATSDIR)-parallel; \ acats_sums= ; acats_logs= ; \ for idx in "" $(check_acats_subdirs); do \ [ -d $(ACATSDIR)$$idx ] || continue; \ mv -f $(ACATSDIR)$$idx/acats.sum $(ACATSDIR)$$idx/acats.sum.sep; \ mv -f $(ACATSDIR)$$idx/acats.log $(ACATSDIR)$$idx/acats.log.sep; \ acats_sums="$$acats_sums $(ACATSDIR)$$idx/acats.sum.sep"; \ acats_logs="$$acats_logs $(ACATSDIR)$$idx/acats.log.sep"; \ done; \ $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh \ $$acats_sums > $(ACATSDIR)/acats.sum; \ $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L \ $$acats_logs > $(ACATSDIR)/acats.log; \ exit 0; \ fi; \ testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \ export testdir; cd $(ACATSDIR) && $(SHELL) $${testdir}/$(ACATSCMD) $(CHAPTERS) check-acats-subtargets: @echo check-acats # Parallelized check-acats $(check_acats_targets): check-acats%: if [ -f $$GCC_RUNTEST_PARALLELIZE_DIR/finished ]; then \ rm -rf $(ACATSDIR)$*; exit 0; \ fi; \ test -d $(ACATSDIR)$* || mkdir -p $(ACATSDIR)$*; \ testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \ export testdir; cd $(ACATSDIR)$* && $(SHELL) $${testdir}/$(ACATSCMD) touch $$GCC_RUNTEST_PARALLELIZE_DIR/finished .PHONY: check-acats $(check_acats_targets) # Compiling object files from source files. # Ada language specific files. ada/b_gnat1.adb : $(GNAT1_ADA_OBJS) # Old gnatbind do not allow a path for -o. $(GNATBIND) $(ADA_INCLUDES) -o b_gnat1.adb -n ada/gnat1drv.ali $(MV) b_gnat1.adb b_gnat1.ads ada/ ada/b_gnat1.o : ada/b_gnat1.adb # Do not use ADAFLAGS to get rid of -gnatg which generates a lot # of style messages. $(CC) -c $(CFLAGS) $(ADA_CFLAGS) -gnatp -gnatws $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) ada/b_gnatb.adb : $(GNATBIND_OBJS) ada/gnatbind.o ada/interfac.o # Old gnatbind do not allow a path for -o. $(GNATBIND) $(ADA_INCLUDES) -o b_gnatb.adb ada/gnatbind.ali $(MV) b_gnatb.adb b_gnatb.ads ada/ ada/b_gnatb.o : ada/b_gnatb.adb $(CC) -c $(CFLAGS) $(ADA_CFLAGS) -gnatp -gnatws $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) include $(srcdir)/ada/Make-generated.in update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \ ada/nmake.ads $(RM) $(addprefix $(srcdir)/ada/,$(notdir $^)) $(CP) $^ $(srcdir)/ada ada/sdefault.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/hostparm.ads ada/namet.ads \ ada/opt.ads ada/osint.ads ada/output.ads ada/sdefault.ads ada/sdefault.adb \ ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ ada/s-stalib.ads ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ ada/s-sopco5.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ ada/s-wchcon.ads ada/system.ads ada/table.adb ada/table.ads ada/tree_io.ads \ ada/types.ads ada/unchdeal.ads ada/unchconv.ads # Special flags - see gcc-interface/Makefile.in for the template. ada/a-except.o : ada/a-except.adb ada/a-except.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \ $(ADA_INCLUDES) $< $(OUTPUT_OPTION) @$(ADA_DEPS) ada/s-excdeb.o : ada/s-excdeb.adb ada/s-excdeb.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ $(ADA_INCLUDES) $< $(OUTPUT_OPTION) @$(ADA_DEPS) ada/s-assert.o : ada/s-assert.adb ada/s-assert.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) @$(ADA_DEPS) ada/a-tags.o : ada/a-tags.adb ada/a-tags.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) @$(ADA_DEPS) # Handling of gnatvsn version string # This ensure the build works even if there is no GNAT_DATE present in the # sources ada/GNAT_DATE: touch ada/GNAT_DATE ada/generated/gnatvsn.ads: ada/gnatvsn.ads BASE-VER ada/GNAT_DATE $(MKDIR) ada/generated s=`cat $(srcdir)/BASE-VER | sed -e "s/\([0-9]*\)\.\([0-9]*\)\..*/-\1\2/g"`; \ d=`if test -f $(srcdir)/ada/GNAT_DATE; then \ cat $(srcdir)/ada/GNAT_DATE; else date +%Y%m%d; fi`; \ cat $< | sed -e "/Version/s/(\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*)/($$d$$s)/g" >$@ ada/gnatvsn.o : ada/gnatvsn.adb ada/generated/gnatvsn.ads $(CC) -c $(ALL_ADAFLAGS) -Iada/generated -I../ada/generated $(ADA_INCLUDES) $< $(OUTPUT_OPTION) @$(ADA_DEPS) # Dependencies for windows specific tool (mdll) ada/mdll.o : ada/mdll.adb ada/mdll.ads ada/mdll-fil.ads ada/mdll-utl.ads $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) ada/mdll-fil.o : ada/mdll-fil.adb ada/mdll.ads ada/mdll-fil.ads $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.ads ada/types.ads $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) ada_generated_files = ada/sinfo.h ada/einfo.h ada/nmake.adb ada/nmake.ads \ ada/treeprs.ads ada/snames.ads ada/snames.adb ada/snames.h \ ada/generated/gnatvsn.ads # When building from scratch we don't have dependency files, the only thing # we need to ensure is that the generated files are created first. $(GNAT1_OBJS) $(GNATBIND_OBJS): | $(ada_generated_files) # Manually include the auto-generated dependencies for the Ada host objects. ADA_DEPFILES = $(foreach obj,$(GNAT1_ADA_OBJS) $(GNATBIND_OBJS),\ $(dir $(obj))/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj)))) -include $(ADA_DEPFILES) # Automatically include the auto-generated dependencies for the C host objects. ada_OBJS = $(GNAT1_C_OBJS)