1 # Top level -*- makefile -*- fragment for GNU Ada (GNAT).
2 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
4 # Free Software Foundation, Inc.
6 #This file is part of GCC.
8 #GCC is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 3, or (at your option)
13 #GCC is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 #GNU General Public License for more details.
18 #You should have received a copy of the GNU General Public License
19 #along with GCC; see the file COPYING3. If not see
20 #<http://www.gnu.org/licenses/>.
22 # This file provides the language dependent support in the main Makefile.
23 # Each language makefile fragment must provide the following targets:
25 # foo.all.cross, foo.start.encap, foo.rest.encap,
26 # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
27 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
28 # foo.mostlyclean, foo.clean, foo.distclean,
29 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
31 # where `foo' is the name of the language.
33 # It should also provide rules for:
35 # - making any compiler driver (eg: g++)
36 # - the compiler proper (eg: cc1plus)
37 # - define the names for selecting the language in LANGUAGES.
47 # Extra flags to pass to recursive makes.
48 COMMON_ADAFLAGS= -gnatpg
49 ifeq ($(TREECHECKING),)
52 CHECKING_ADAFLAGS= -gnata
54 WARN_ADAFLAGS= -W -Wall
56 # For native builds, the base compiler might be old and we need to arrange for
57 # style warnings not to be flagged as errors during stage1. Cross compilers
58 # need to be built by a recent/matching native so we might as well leave the
59 # checks fully active.
62 ADAFLAGS= $(COMMON_ADAFLAGS) -gnatwns
64 ADAFLAGS= $(COMMON_ADAFLAGS)
68 $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS) $(CHECKING_ADAFLAGS) $(WARN_ADAFLAGS)
69 FORCE_DEBUG_ADAFLAGS = -g
71 ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
72 GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
73 GNATLIBCFLAGS= -g -O2 $(TCFLAGS)
74 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
75 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
78 # We do not want the WARN_CFLAGS of the compiler in Ada as it is for C/C++.
79 COMMON_FLAGS_TO_PASS = $(filter-out $(WARN_CFLAGS), $(FLAGS_TO_PASS))
81 "ADA_FOR_BUILD=$(ADA_FOR_BUILD)" \
82 "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)" \
83 "ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)" \
84 "ADAFLAGS=$(ADAFLAGS) $(WARN_ADAFLAGS)" \
85 "ADA_FOR_TARGET=$(ADA_FOR_TARGET)" \
86 "INSTALL=$(INSTALL)" \
87 "INSTALL_DATA=$(INSTALL_DATA)" \
88 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
90 # List of Ada tools to build and install
91 ADA_TOOLS=gnatbind gnatchop gnat gnatkr gnatlink gnatls gnatmake \
92 gnatname gnatprep gnatxref gnatfind gnatclean gnatsym
94 # Say how to compile Ada programs.
95 .SUFFIXES: .ada .adb .ads
97 # FIXME: need to add $(ADA_CFLAGS) to .c.o suffix rule
98 # Use mildly strict warnings for this front end and add special flags.
99 ada-warn = $(ADA_CFLAGS) $(filter-out -pedantic, $(STRICT_WARN))
100 # Unresolved warnings in specific files.
101 ada/adaint.o-warn = -Wno-error
103 ada/%.o: ada/gcc-interface/%.c
107 # Function that dumps the dependencies of an Ada object file by parsing the
108 # associated ALI file. We match the lines starting with D to achieve that.
109 ADA_DEPS=case $@ in \
111 *)a="`echo $@ | sed -e 's/.o$$/.ali/'`"; \
112 echo "$@: `cat $$a | \
113 sed -ne 's;^D \([a-z0-9_\.-]*\).*;ada/\1;gp' | \
114 tr -d '\015' | tr '\n' ' '`" > $(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@));; \
118 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
122 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
125 # Define the names for selecting Ada in LANGUAGES.
126 ada: gnat1$(exeext) gnatbind$(exeext)
128 # Tell GNU Make to ignore these, if they exist.
132 -B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
133 -B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \
134 -L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
135 -L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
137 # There are too many Ada sources to check against here. Let's
138 # always force the recursive make.
139 ifeq ($(build), $(host))
140 ifeq ($(host), $(target))
141 # This is a regular native. So use the compiler from our current build
143 ADA_TOOLS_FLAGS_TO_PASS=\
144 CC="../../xgcc -B../../" \
145 CXX="../../xg++ -B../../ $(CXX_LFLAGS)" \
146 $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
147 ADA_INCLUDES="-I- -I../rts" \
148 GNATMAKE="../../gnatmake" \
149 GNATLINK="../../gnatlink" \
150 GNATBIND="../../gnatbind"
152 # This is a regular cross compiler. Use the native compiler to compile
155 # put the host RTS dir first in the PATH to hide the default runtime
156 # files that are among the sources
157 ifneq ($(findstring ada,$(LANGUAGES)),)
158 RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
161 ADA_TOOLS_FLAGS_TO_PASS=\
164 $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
165 ADA_INCLUDES="-I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
166 GNATMAKE="gnatmake" \
167 GNATBIND="gnatbind" \
168 GNATLINK="gnatlink" \
172 # Build is different from host so we are either building a canadian cross
173 # or a cross-native compiler. We provide defaults for tools targeting the
174 # host platform, but they can be overriden by just setting <tool>_FOR_HOST
176 GNATMAKE_FOR_HOST=$(host)-gnatmake
177 GNATBIND_FOR_HOST=$(host)-gnatbind
178 GNATLINK_FOR_HOST=$(host)-gnatlink
179 GNATLS_FOR_HOST=$(host)-gnatls
181 ifeq ($(host), $(target))
182 # This is a cross native. All the sources are taken from the currently
184 ADA_TOOLS_FLAGS_TO_PASS=\
187 $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
188 ADA_INCLUDES="-I../rts" \
189 GNATMAKE="$(GNATMAKE_FOR_HOST)" \
190 GNATBIND="$(GNATBIND_FOR_HOST)" \
191 GNATLINK="$(GNATLINK_FOR_HOST)" \
194 # This is a canadian cross. We should use a toolchain running on the
195 # build platform and targeting the host platform.
196 ifneq ($(findstring ada,$(LANGUAGES)),)
197 RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
199 ADA_TOOLS_FLAGS_TO_PASS=\
202 $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
203 ADA_INCLUDES="-I$(RTS_DIR)/../adainclude -I$(RTS_DIR)" \
204 GNATMAKE="$(GNATMAKE_FOR_HOST)" \
205 GNATBIND="$(GNATBIND_FOR_HOST)" \
206 GNATLINK="$(GNATLINK_FOR_HOST)" \
211 # Strip -Werror during linking for the LTO bootstrap
212 GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS))
214 GCC_LINK=$(LINKER) $(GCC_LINKERFLAGS) $(LDFLAGS)
215 GCC_LLINK=$(LLINKER) $(GCC_LINKERFLAGS) $(LDFLAGS)
217 # Lists of files for various purposes.
219 # Languages-specific object files for Ada.
221 # Object files for gnat1 from C sources.
222 GNAT1_C_OBJS = ada/adadecode.o ada/adaint.o ada/argv.o ada/cio.o \
223 ada/cstreams.o ada/env.o ada/init.o ada/initialize.o ada/raise.o \
224 ada/seh_init.o ada/targext.o ada/cuintp.o ada/decl.o \
225 ada/misc.o ada/utils.o ada/utils2.o ada/trans.o ada/targtyps.o
227 # Object files from Ada sources that are used by gnat1
297 ada/get_spark_xrefs.o \
326 ada/put_spark_xrefs.o \
454 # Object files for gnat executables
455 GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
457 GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS) ada/b_gnat1.o
586 # Language-independent object files.
587 ADA_BACKEND = $(BACKEND) attribs.o
589 # List of target dependent sources, overridden below as necessary
592 # Needs to be built with CC=gcc
593 # Since the RTL should be built with the latest compiler, remove the
594 # stamp target in the parent directory whenever gnat1 is rebuilt
595 gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target.a $(LIBDEPS)
596 +$(GCC_LLINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) \
597 libcommon-target.a $(LIBS) $(SYSLIBS) $(BACKENDLIBS) $(CFLAGS)
598 $(RM) stamp-gnatlib2-rts stamp-tools
600 gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBDEPS)
601 +$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBS) $(SYSLIBS) $(CFLAGS)
603 # use target-gcc target-gnatmake target-gnatbind target-gnatlink
604 gnattools: $(GCC_PARTS) $(CONFIG_H) prefix.o force
605 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1
606 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
609 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
610 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
612 cross-gnattools: force
613 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
614 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
615 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools4
617 canadian-gnattools: force
618 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
619 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
620 $(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools4
622 gnatlib gnatlib-sjlj gnatlib-zcx gnatlib-shared: force
623 $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) \
624 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
625 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
626 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
627 THREAD_KIND="$(THREAD_KIND)" \
629 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
632 # use only for native compiler
633 gnatlib_and_tools: gnatlib gnattools
638 for tool in $(ADA_TOOLS) ; do \
639 if [ -f $$tool$(exeext) ] ; \
641 $(MV) $$tool$(exeext) $$tool-cross$(exeext); \
652 cd $(srcdir)/ada && etags -o TAGS.sub *.c *.h *.ads *.adb && \
653 etags --include TAGS.sub --include ../TAGS.sub
656 # Generate documentation.
658 ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
659 -$(MKDIR) ada/doctools
660 $(CP) $^ ada/doctools
661 cd ada/doctools && gnatmake -q xgnatugn
663 # Note that doc/gnat_ugn.texi and doc/projects.texi do not depend on
664 # xgnatugn being built so we can distribute a pregenerated doc/gnat_ugn.info
666 doc/gnat_ugn.texi: $(srcdir)/ada/gnat_ugn.texi $(srcdir)/ada/ug_words \
667 doc/projects.texi $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
668 $(MAKE) ada/doctools/xgnatugn$(build_exeext)
669 ada/doctools/xgnatugn unw $(srcdir)/ada/gnat_ugn.texi \
670 $(srcdir)/ada/ug_words doc/gnat_ugn.texi
672 doc/projects.texi: $(srcdir)/ada/projects.texi
673 $(MAKE) ada/doctools/xgnatugn$(build_exeext)
674 ada/doctools/xgnatugn unw $(srcdir)/ada/projects.texi \
675 $(srcdir)/ada/ug_words doc/projects.texi
677 doc/gnat_ugn.info: doc/gnat_ugn.texi \
678 $(gcc_docdir)/include/fdl.texi $(gcc_docdir)/include/gcc-common.texi \
680 if [ x$(BUILD_INFO) = xinfo ]; then \
682 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \
683 -I$(srcdir)/ada -o $@ $<; \
686 doc/gnat_rm.info: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \
687 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
688 if [ x$(BUILD_INFO) = xinfo ]; then \
690 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \
691 -I$(srcdir)/ada -o $@ $<; \
694 doc/gnat-style.info: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi \
695 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
696 if [ x$(BUILD_INFO) = xinfo ]; then \
698 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(gcc_docdir)/include \
699 -I$(srcdir)/ada -o $@ $<; \
702 ADA_INFOFILES = doc/gnat_ugn.info doc/gnat_ugn.texi \
703 doc/gnat_rm.info doc/gnat-style.info
705 ada.info: $(ADA_INFOFILES)
707 ada.srcinfo: $(ADA_INFOFILES)
708 -$(CP) $^ $(srcdir)/doc
710 ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
711 $(DESTDIR)$(infodir)/gnat_rm.info \
712 $(DESTDIR)$(infodir)/gnat-style.info
714 ada.dvi: doc/gnat_ugn.dvi \
715 doc/gnat_rm.dvi doc/gnat-style.dvi
717 ADA_PDFFILES = doc/gnat_ugn.pdf \
718 doc/gnat_rm.pdf doc/gnat-style.pdf
720 ada.pdf: $(ADA_PDFFILES)
722 ada.install-pdf: $(ADA_PDFFILES)
724 test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
725 @list='$(ADA_PDFFILES)'; for p in $$list; do \
726 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
727 f=$(pdf__strip_dir) \
728 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
729 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
736 doc/gnat_ugn.dvi: doc/gnat_ugn.texi $(gcc_docdir)/include/fdl.texi \
737 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
738 $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $<
740 doc/gnat_rm.dvi: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \
741 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
742 $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $<
744 doc/gnat-style.dvi: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi
745 $(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $<
747 doc/gnat_ugn.pdf: doc/gnat_ugn.texi $(gcc_docdir)/include/fdl.texi \
748 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
749 $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $<
751 doc/gnat_rm.pdf: ada/gnat_rm.texi $(gcc_docdir)/include/fdl.texi \
752 $(gcc_docdir)/include/gcc-common.texi gcc-vers.texi
753 $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $<
755 doc/gnat-style.pdf: ada/gnat-style.texi $(gcc_docdir)/include/fdl.texi
756 $(TEXI2PDF) -c -I $(abs_docdir)/include -o $@ $<
760 # gnat1 is installed elsewhere as part of $(COMPILERS).
762 # Install the binder program as gnatbind (native) or $(prefix)gnatbind
763 # (cross). $(prefix) comes from the --program-prefix configure option,
764 # or from the --target option if the former is not specified.
765 # Do the same for the rest of the Ada tools (gnatchop, gnat, gnatkr,
766 # gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref, gnatfind,
767 # gnatclean, gnatsym).
768 # gnatsym is only built on some platforms, including VMS.
769 # gnatdll is only used on Windows.
770 # vxaddr2line is only used for cross VxWorks ports (it calls the underlying
773 $(MKDIR) $(DESTDIR)$(bindir)
774 -if [ -f gnat1$(exeext) ] ; \
776 for tool in $(ADA_TOOLS) ; do \
777 install_name=`echo $$tool|sed '$(program_transform_name)'`$(exeext); \
778 $(RM) $(DESTDIR)$(bindir)/$$install_name; \
779 if [ -f $$tool-cross$(exeext) ] ; \
781 $(INSTALL_PROGRAM) $$tool-cross$(exeext) $(DESTDIR)$(bindir)/$$install_name; \
783 $(INSTALL_PROGRAM) $$tool$(exeext) $(DESTDIR)$(bindir)/$$install_name; \
786 $(RM) $(DESTDIR)$(bindir)/gnatdll$(exeext); \
787 $(INSTALL_PROGRAM) gnatdll$(exeext) $(DESTDIR)$(bindir)/gnatdll$(exeext); \
788 if [ -f vxaddr2line$(exeext) ] ; \
790 $(RM) $(DESTDIR)$(bindir)/vxaddr2line$(exeext); \
791 $(INSTALL_PROGRAM) vxaddr2line$(exeext) $(DESTDIR)$(bindir)/vxaddr2line$(exeext); \
796 # Finally, install the library
798 -if [ -f gnat1$(exeext) ] ; \
800 $(MAKE) $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib; \
804 $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib$(LIBGNAT_TARGET)
807 $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib-obj
813 for tool in $(ADA_TOOLS) ; do \
814 install_name=`echo $$tool|sed '$(program_transform_name)'`$(exeext); \
815 -$(RM) $(DESTDIR)$(bindir)/$$install_name; \
817 -$(RM) $(DESTDIR)$(tooldir)/bin/gnatdll$(exeext)
818 -$(RM) $(DESTDIR)$(tooldir)/bin/vxaddr2line$(exeext)
821 # A lot of the ancillary files are deleted by the main makefile.
822 # We just have to delete files specific to us.
825 -$(RM) ada/*$(objext) ada/*.ali ada/b_gnat*.ads ada/b_gnat*.adb
826 -$(RM) ada/*$(coverageexts)
827 -$(RM) ada/sdefault.adb ada/stamp-sdefault ada/stamp-snames
832 -$(RM) gnatchop$(exeext)
834 -$(RM) gnatdll$(exeext)
835 -$(RM) gnatkr$(exeext)
836 -$(RM) gnatlink$(exeext)
837 -$(RM) gnatls$(exeext)
838 -$(RM) gnatmake$(exeext)
839 -$(RM) gnatname$(exeext)
840 -$(RM) gnatprep$(exeext)
841 -$(RM) gnatfind$(exeext)
842 -$(RM) gnatxref$(exeext)
843 -$(RM) gnatclean$(exeext)
844 -$(RM) gnatsym$(exeext)
849 ada.maintainer-clean:
854 -$(RM) ada/treeprs.ads
855 -$(RM) ada/snames.ads ada/snames.adb ada/snames.h
858 # The main makefile has already created stage?/ada
860 ada.stage1: stage1-start
861 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage1/ada
862 -$(MV) ada/stamp-* stage1/ada
863 ada.stage2: stage2-start
864 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage2/ada
865 -$(MV) ada/stamp-* stage2/ada
866 ada.stage3: stage3-start
867 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage3/ada
868 -$(MV) ada/stamp-* stage3/ada
869 ada.stage4: stage4-start
870 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stage4/ada
871 -$(MV) ada/stamp-* stage4/ada
872 ada.stageprofile: stageprofile-start
873 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stageprofile/ada
874 -$(MV) ada/stamp-* stageprofile/ada
875 ada.stagefeedback: stagefeedback-start
876 -$(MV) ada/*$(objext) ada/*.ali ada/b_gnat*.ad* stagefeedback/ada
877 -$(MV) ada/stamp-* stagefeedback/ada
879 lang_checks += check-gnat
881 check-ada: check-acats check-gnat
882 check-ada-subtargets: check-acats-subtargets check-gnat-subtargets
884 ACATSDIR = $(TESTSUITEDIR)/ada/acats
886 check_acats_targets = $(patsubst %,check-acats%, 0 1 2)
889 @test -d $(ACATSDIR) || mkdir -p $(ACATSDIR); \
890 rootme=`${PWD_COMMAND}`; export rootme; \
891 EXPECT=$(EXPECT); export EXPECT; \
892 if [ -z "$(CHAPTERS)" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; \
894 $(MAKE) $(check_acats_targets); \
895 for idx in 0 1 2; do \
896 mv -f $(ACATSDIR)$$idx/acats.sum $(ACATSDIR)$$idx/acats.sum.sep; \
897 mv -f $(ACATSDIR)$$idx/acats.log $(ACATSDIR)$$idx/acats.log.sep; \
899 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh \
900 $(ACATSDIR)0/acats.sum.sep $(ACATSDIR)1/acats.sum.sep \
901 $(ACATSDIR)2/acats.sum.sep > $(ACATSDIR)/acats.sum; \
902 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L \
903 $(ACATSDIR)0/acats.log.sep $(ACATSDIR)1/acats.log.sep \
904 $(ACATSDIR)2/acats.log.sep > $(ACATSDIR)/acats.log; \
907 testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
908 export testdir; cd $(ACATSDIR) && $(SHELL) $${testdir}/run_acats $(CHAPTERS)
910 check-acats-subtargets:
911 @echo $(check_acats_targets)
913 # Parallelized check-acats
914 $(check_acats_targets): check-acats%:
915 test -d $(ACATSDIR)$* || mkdir -p $(ACATSDIR)$*; \
916 testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
918 0) chapters="`cd $$testdir/tests; echo [a-b]* c[0-4]*`";; \
919 1) chapters="`cd $$testdir/tests; echo c[5-9ab]*`";; \
920 2) chapters="`cd $$testdir/tests; echo c[c-z]* [d-z]*`";; \
922 export testdir; cd $(ACATSDIR)$* && $(SHELL) $${testdir}/run_acats $$chapters
924 .PHONY: check-acats $(check_acats_targets)
926 # Compiling object files from source files.
928 # Ada language specific files.
930 ada/b_gnat1.adb : $(GNAT1_ADA_OBJS)
931 # Old gnatbind do not allow a path for -o.
932 $(GNATBIND) $(ADA_INCLUDES) -o b_gnat1.adb -n ada/gnat1drv.ali
933 $(MV) b_gnat1.adb b_gnat1.ads ada/
935 ada/b_gnat1.o : ada/b_gnat1.adb
936 # Do not use ADAFLAGS to get rid of -gnatg which generates a lot
938 $(CC) -c $(CFLAGS) $(ADA_CFLAGS) -gnatp -gnatws $(ADA_INCLUDES) \
941 ada/b_gnatb.adb : $(GNATBIND_OBJS) ada/gnatbind.o ada/interfac.o
942 # Old gnatbind do not allow a path for -o.
943 $(GNATBIND) $(ADA_INCLUDES) -o b_gnatb.adb ada/gnatbind.ali
944 $(MV) b_gnatb.adb b_gnatb.ads ada/
946 ada/b_gnatb.o : ada/b_gnatb.adb
947 $(CC) -c $(CFLAGS) $(ADA_CFLAGS) -gnatp -gnatws $(ADA_INCLUDES) \
950 include $(srcdir)/ada/Make-generated.in
952 update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \
954 $(RM) $(addprefix $(srcdir)/ada/,$(notdir $^))
955 $(CP) $^ $(srcdir)/ada
957 ada/sdefault.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
958 ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/hostparm.ads ada/namet.ads \
959 ada/opt.ads ada/osint.ads ada/output.ads ada/sdefault.ads ada/sdefault.adb \
960 ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
961 ada/s-stalib.ads ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
962 ada/s-sopco5.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
963 ada/s-wchcon.ads ada/system.ads ada/table.adb ada/table.ads ada/tree_io.ads \
964 ada/types.ads ada/unchdeal.ads ada/unchconv.ads
966 # Special flags - see gcc-interface/Makefile.in for the template.
968 ada/a-except.o : ada/a-except.adb ada/a-except.ads
969 $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
970 $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
973 ada/s-excdeb.o : ada/s-excdeb.adb ada/s-excdeb.ads
974 $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \
975 $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
978 ada/s-assert.o : ada/s-assert.adb ada/s-assert.ads
979 $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
983 ada/a-tags.o : ada/a-tags.adb ada/a-tags.ads
984 $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
988 # Dependencies for windows specific tool (mdll)
990 ada/mdll.o : ada/mdll.adb ada/mdll.ads ada/mdll-fil.ads ada/mdll-utl.ads
991 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
993 ada/mdll-fil.o : ada/mdll-fil.adb ada/mdll.ads ada/mdll-fil.ads
994 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
996 ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.ads ada/types.ads
997 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
999 ada_generated_files = ada/sinfo.h ada/einfo.h ada/nmake.adb ada/nmake.ads \
1000 ada/treeprs.ads ada/snames.ads ada/snames.adb ada/snames.h
1002 # When building from scratch we don't have dependency files, the only thing
1003 # we need to ensure is that the generated files are created first.
1004 $(GNAT1_ADA_OBJS) $(GNATBIND_OBJS): | $(ada_generated_files)
1006 # Manually include the auto-generated dependencies for the Ada host objects.
1007 ADA_DEPFILES = $(foreach obj,$(GNAT1_ADA_OBJS) $(GNATBIND_OBJS),\
1008 $(dir $(obj))/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj))))
1009 -include $(ADA_DEPFILES)
1011 # Automatically include the auto-generated dependencies for the C host objects.
1012 ada_OBJS = $(GNAT1_C_OBJS)