2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
4 # 1999, 2000, 2001 Free Software Foundation
6 # This file is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 exec_prefix = $(prefix)
26 bindir=${exec_prefix}/bin
27 sbindir=${exec_prefix}/sbin
28 libexecdir=${exec_prefix}/libexec
29 datadir=${prefix}/share
30 sysconfdir=${prefix}/etc
31 sharedstatedir=${prefix}/com
32 localstatedir=${prefix}/var
33 libdir=${exec_prefix}/lib
34 includedir=${prefix}/include
35 oldincludedir=/usr/include
36 infodir=${prefix}/info
38 gxx_include_dir=${includedir}/g++
40 tooldir = $(exec_prefix)/$(target_alias)
41 build_tooldir = $(exec_prefix)/$(target_alias)
43 program_transform_name =
45 man1dir = $(mandir)/man1
46 man2dir = $(mandir)/man2
47 man3dir = $(mandir)/man3
48 man4dir = $(mandir)/man4
49 man5dir = $(mandir)/man5
50 man6dir = $(mandir)/man6
51 man7dir = $(mandir)/man7
52 man8dir = $(mandir)/man8
53 man9dir = $(mandir)/man9
54 infodir = $(prefix)/info
55 includedir = $(prefix)/include
56 # Directory in which the compiler finds executables, libraries, etc.
57 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
62 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
64 INSTALL_PROGRAM_ARGS =
66 INSTALL = $(SHELL) $$s/install-sh -c
67 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
68 INSTALL_SCRIPT = $(INSTALL)
69 INSTALL_DATA = $(INSTALL) -m 644
71 INSTALL_DOSREL = install-dosrel-fake
78 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
79 # here so that they can be overridden by Makefile fragments.
80 HOST_CC = $(CC_FOR_BUILD)
82 HOST_PREFIX_1 = loser-
84 # These flag values are normally overridden by the configure script.
90 CFLAGS_FOR_BUILD = $(CFLAGS)
91 CFLAGS_FOR_TARGET = $(CFLAGS)
93 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
97 CHILLFLAGS = $(CFLAGS)
101 # Use -O2 to stress test the compiler.
102 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
103 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
104 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
116 # These values are substituted by configure.
121 BISON = `if [ -f $$r/bison/bison ] ; then \
122 echo $$r/bison/bison -L $$s/bison/ ; \
127 YACC = `if [ -f $$r/bison/bison ] ; then \
128 echo $$r/bison/bison -y -L $$s/bison/ ; \
129 elif [ -f $$r/byacc/byacc ] ; then \
130 echo $$r/byacc/byacc ; \
132 echo ${DEFAULT_YACC} ; \
135 LEX = `if [ -f $$r/flex/flex ] ; \
136 then echo $$r/flex/flex ; \
137 else echo ${DEFAULT_LEX} ; fi`
139 M4 = `if [ -f $$r/m4/m4 ] ; \
140 then echo $$r/m4/m4 ; \
141 else echo ${DEFAULT_M4} ; fi`
143 # For an installed makeinfo, we require it to be from texinfo 4 or
144 # higher, else we use the "missing" dummy.
145 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
146 then echo $$r/texinfo/makeinfo/makeinfo ; \
147 else if (makeinfo --version \
148 | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
149 then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
151 # This just becomes part of the MAKEINFO definition passed down to
152 # sub-makes. It lets flags be given on the command line while still
153 # using the makeinfo from the object tree.
156 EXPECT = `if [ -f $$r/expect/expect ] ; \
157 then echo $$r/expect/expect ; \
158 else echo expect ; fi`
160 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
161 then echo $$s/dejagnu/runtest ; \
162 else echo runtest ; fi`
165 # compilers to use to create programs which must be run in the build
168 CXX_FOR_BUILD = $(CXX)
170 SUBDIRS = "this is set via configure, don't edit this"
173 # This is set by the configure script to the list of directories which
174 # should be built using the target tools.
175 TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib librx winsup opcodes bsp libstub cygmon libf2c libchill libobjc
177 # Target libraries are put under this directory:
178 # Changed by configure to $(target_alias) if cross.
181 # This is set by the configure script to the arguments passed to configure.
184 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
188 # This is the name of the environment variable used for the path to
189 # the libraries. This may be changed by configure.in.
190 RPATH_ENVVAR = LD_LIBRARY_PATH
192 # This is the list of directories that may be needed in RPATH_ENVVAR
193 # so that programs built for the host machine work.
194 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
196 # This is the list of directories that may be needed in RPATH_ENVVAR
197 # so that prorgams built for the target machine work.
198 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
200 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
201 # Some platforms don't like blank entries, so we remove duplicate,
202 # leading and trailing colons.
203 REALLY_SET_LIB_PATH = \
204 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
207 INSTALL_TARGET = installdirs \
210 $(INSTALL_TARGET_MODULES) \
211 $(INSTALL_X11_MODULES) \
214 INSTALL_TARGET_CROSS = installdirs \
217 $(INSTALL_TARGET_MODULES) \
218 $(INSTALL_X11_MODULES) \
221 # Should be substed by configure.in
226 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
229 # If GCC_FOR_TARGET is not overriden on the command line, then this
230 # variable is passed down to the gcc Makefile, where it is used to
231 # build libgcc2.a. We define it here so that it can itself be
232 # overridden on the command line.
233 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
236 if [ -f $$r/gas/as-new ] ; then \
237 echo $$r/gas/as-new ; \
238 elif [ -f $$r/gcc/xgcc ]; then \
239 $(CC_FOR_TARGET) -print-prog-name=as ; \
241 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
244 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
249 if [ -f $$r/ld/ld-new ] ; then \
250 echo $$r/ld/ld-new ; \
251 elif [ -f $$r/gcc/xgcc ]; then \
252 $(CC_FOR_TARGET) -print-prog-name=ld ; \
254 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
257 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
261 DLLTOOL_FOR_TARGET = ` \
262 if [ -f $$r/binutils/dlltool ] ; then \
263 echo $$r/binutils/dlltool ; \
265 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
268 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
272 WINDRES_FOR_TARGET = ` \
273 if [ -f $$r/binutils/windres ] ; then \
274 echo $$r/binutils/windres ; \
276 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
279 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
284 if [ -f $$r/binutils/ar ] ; then \
285 echo $$r/binutils/ar ; \
287 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
290 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
294 RANLIB_FOR_TARGET = ` \
295 if [ -f $$r/binutils/ranlib ] ; then \
296 echo $$r/binutils/ranlib ; \
298 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
299 if [ x'$(RANLIB)' != x ]; then \
305 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
310 if [ -f $$r/binutils/nm-new ] ; then \
311 echo $$r/binutils/nm-new ; \
312 elif [ -f $$r/gcc/xgcc ]; then \
313 $(CC_FOR_TARGET) -print-prog-name=nm ; \
315 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
318 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
322 # The first rule in the file had better be this one. Don't put any above it.
323 # This lives here to allow makefile fragments to contain dependencies.
327 # These can be overridden by config/mt-*.
328 # The _TARGET_ is because they're specified in mt-foo.
329 # The _HOST_ is because they're programs that run on the host.
330 EXTRA_TARGET_HOST_ALL_MODULES =
331 EXTRA_TARGET_HOST_INSTALL_MODULES =
332 EXTRA_TARGET_HOST_CHECK_MODULES =
334 #### host and target specific makefile fragments come in here.
337 # Flags to pass down to all sub-makes.
338 # Please keep these in alphabetical order.
339 BASE_FLAGS_TO_PASS = \
340 "AR_FLAGS=$(AR_FLAGS)" \
341 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
342 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
344 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
345 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
347 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
348 "CHILLFLAGS=$(CHILLFLAGS)" \
349 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
350 "CHILL_LIB=$(CHILL_LIB)" \
351 "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
352 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
353 "CXXFLAGS=$(CXXFLAGS)" \
354 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
355 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
356 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
357 "INSTALL=$(INSTALL)" \
358 "INSTALL_DATA=$(INSTALL_DATA)" \
359 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
360 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
361 "LDFLAGS=$(LDFLAGS)" \
363 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
364 "LIBCFLAGS=$(LIBCFLAGS)" \
365 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
366 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
367 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
370 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
371 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
372 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
373 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
376 "RUNTEST=$(RUNTEST)" \
377 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
378 "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
379 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
382 "datadir=$(datadir)" \
383 "exec_prefix=$(exec_prefix)" \
384 "includedir=$(includedir)" \
385 "infodir=$(infodir)" \
387 "libexecdir=$(libexecdir)" \
388 "lispdir=$(lispdir)" \
389 "libstdcxx_incdir=$(libstdcxx_incdir)" \
390 "libsubdir=$(libsubdir)" \
391 "localstatedir=$(localstatedir)" \
393 "oldincludedir=$(oldincludedir)" \
395 "sbindir=$(sbindir)" \
396 "sharedstatedir=$(sharedstatedir)" \
397 "sysconfdir=$(sysconfdir)" \
398 "tooldir=$(tooldir)" \
399 "build_tooldir=$(build_tooldir)" \
400 "gxx_include_dir=$(gxx_include_dir)" \
401 "gcc_version=$(gcc_version)" \
402 "gcc_version_trigger=$(gcc_version_trigger)" \
403 "target_alias=$(target_alias)"
405 # For any flags above that may contain shell code that varies from one
406 # target library to another. When doing recursive invocations of the
407 # top-level Makefile, we don't want the outer make to evaluate them,
408 # so we pass these variables down unchanged. They must not contain
409 # single nor double quotes.
411 CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
413 # Flags to pass down to most sub-makes, in which we're building with
414 # the host environment.
415 # If any variables are added here, they must be added to do-*, below.
421 'DLLTOOL=$(DLLTOOL)' \
424 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
427 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
429 # Flags that are concerned with the location of the X11 include files
432 # NOTE: until the top-level is getting the values via autoconf, it only
433 # causes problems to have this top-level Makefile overriding the autoconf-set
434 # values in child directories. Only variables that don't conflict with
435 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
437 X11_FLAGS_TO_PASS = \
438 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
439 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
441 # Flags to pass down to makes which are built with the target environment.
442 # The double $ decreases the length of the command line; the variables
443 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
444 # If any variables are added here, they must be added to do-*, below.
445 EXTRA_TARGET_FLAGS = \
446 'AR=$$(AR_FOR_TARGET)' \
447 'AS=$$(AS_FOR_TARGET)' \
448 'CC=$$(CC_FOR_TARGET)' \
449 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
450 'CXX=$$(CXX_FOR_TARGET)' \
451 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
452 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
453 'LD=$$(LD_FOR_TARGET)' \
454 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
455 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
456 'NM=$$(NM_FOR_TARGET)' \
457 'RANLIB=$$(RANLIB_FOR_TARGET)' \
458 'WINDRES=$$(WINDRES_FOR_TARGET)'
460 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
462 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
463 # unfortunately needs the native compiler and the target ar and
465 # If any variables are added here, they must be added to do-*, below.
466 # The HOST_* variables are a special case, which are used for the gcc
467 # cross-building scheme.
473 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
474 'HOST_CC=$(CC_FOR_BUILD)' \
475 'HOST_PREFIX=$(HOST_PREFIX)' \
476 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
478 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
479 'WINDRES=$$(WINDRES_FOR_TARGET)' \
480 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
481 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
482 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
483 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
484 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
485 "`echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)' | sed -e s/.*=$$/XFOO=/`" \
486 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
487 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
488 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
489 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
490 "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
491 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
493 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
495 # This is a list of the targets for all of the modules which are compiled
496 # using $(FLAGS_TO_PASS).
566 $(EXTRA_TARGET_HOST_ALL_MODULES)
568 # This is a list of the check targets for all of the modules which are
569 # compiled using $(FLAGS_TO_PASS).
571 # The list is in two parts. The first lists those tools which
572 # are tested as part of the host's native tool-chain, and not
573 # tested in a cross configuration.
574 NATIVE_CHECK_MODULES = \
581 CROSS_CHECK_MODULES = \
640 $(EXTRA_TARGET_HOST_CHECK_MODULES)
642 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
644 # This is a list of the install targets for all of the modules which are
645 # compiled using $(FLAGS_TO_PASS).
646 # We put install-opcodes before install-binutils because the installed
647 # binutils might be on PATH, and they might need the shared opcodes
649 # We put install-tcl before install-itcl because itcl wants to run a
650 # program on installation which uses the Tcl libraries.
717 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
719 # This is a list of the targets for all of the modules which are compiled
720 # using $(X11_FLAGS_TO_PASS).
733 # This is a list of the check targets for all of the modules which are
734 # compiled using $(X11_FLAGS_TO_PASS).
735 CHECK_X11_MODULES = \
745 # This is a list of the install targets for all the modules which are
746 # compiled using $(X11_FLAGS_TO_PASS).
747 INSTALL_X11_MODULES = \
759 # This is a list of the targets for all of the modules which are compiled
760 # using $(TARGET_FLAGS_TO_PASS).
761 ALL_TARGET_MODULES = \
762 all-target-libstdc++-v3 \
766 all-target-libchill \
768 all-target-libtermcap \
770 all-target-libgloss \
771 all-target-libiberty \
773 all-target-examples \
778 all-target-boehm-gc \
779 all-target-qthreads \
783 # This is a list of the configure targets for all of the modules which
784 # are compiled using the target tools.
785 CONFIGURE_TARGET_MODULES = \
786 configure-target-libstdc++-v3 \
787 configure-target-librx \
788 configure-target-newlib \
789 configure-target-libf2c \
790 configure-target-libchill \
791 configure-target-libobjc \
792 configure-target-libtermcap \
793 configure-target-winsup \
794 configure-target-libgloss \
795 configure-target-libiberty \
796 configure-target-gperf \
797 configure-target-examples \
798 configure-target-libstub \
799 configure-target-libffi \
800 configure-target-libjava \
801 configure-target-zlib \
802 configure-target-boehm-gc \
803 configure-target-qthreads \
804 configure-target-bsp \
805 configure-target-cygmon
807 # This is a list of the check targets for all of the modules which are
808 # compiled using $(TARGET_FLAGS_TO_PASS).
809 CHECK_TARGET_MODULES = \
810 check-target-libstdc++-v3 \
811 check-target-newlib \
812 check-target-libf2c \
813 check-target-libchill \
814 check-target-libobjc \
815 check-target-winsup \
816 check-target-libiberty \
817 check-target-libffi \
818 check-target-libjava \
820 check-target-boehm-gc \
821 check-target-qthreads \
824 # This is a list of the install targets for all of the modules which are
825 # compiled using $(TARGET_FLAGS_TO_PASS).
826 INSTALL_TARGET_MODULES = \
827 install-target-libstdc++-v3 \
828 install-target-newlib \
829 install-target-libf2c \
830 install-target-libchill \
831 install-target-libobjc \
832 install-target-libtermcap \
833 install-target-winsup \
834 install-target-libgloss \
835 install-target-libiberty \
837 install-target-libjava \
838 install-target-zlib \
839 install-target-boehm-gc \
840 install-target-qthreads \
843 # This is a list of the targets for which we can do a clean-{target}.
913 # All of the target modules that can be cleaned
914 CLEAN_TARGET_MODULES = \
915 clean-target-libstdc++-v3 \
917 clean-target-newlib \
918 clean-target-libf2c \
919 clean-target-libchill \
920 clean-target-libobjc \
921 clean-target-winsup \
922 clean-target-libgloss \
923 clean-target-libiberty \
925 clean-target-examples \
926 clean-target-libstub \
927 clean-target-libffi \
928 clean-target-libjava \
930 clean-target-boehm-gc \
931 clean-target-qthreads \
935 # All of the x11 modules that can be cleaned
936 CLEAN_X11_MODULES = \
947 # The target built for a native build.
952 $(ALL_TARGET_MODULES) \
955 # Do a target for all the subdirectories. A ``make do-X'' will do a
956 # ``make X'' in all subdirectories (because, in general, there is a
957 # dependency (below) of X upon do-X, a ``make X'' will also do this,
958 # but it may do additional work as well).
959 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
960 # because it is so large that it can easily overflow the command line
961 # length limit on some systems.
970 do-maintainer-clean \
974 @target=`echo $@ | sed -e 's/^do-//'`; \
976 s=`cd $(srcdir); pwd`; export s; \
978 for i in $(SUBDIRS) -dummy-; do \
979 if [ -f ./$$i/Makefile ]; then \
982 for flag in $(EXTRA_GCC_FLAGS); do \
983 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
987 for flag in $(EXTRA_HOST_FLAGS); do \
988 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
993 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
994 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
995 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
996 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
998 then true; else exit 1; fi; \
1001 @target=`echo $@ | sed -e 's/^do-//'`; \
1002 r=`pwd`; export r; \
1003 s=`cd $(srcdir); pwd`; export s; \
1005 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
1006 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
1007 for flag in $(EXTRA_TARGET_FLAGS); do \
1008 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1010 if (cd $(TARGET_SUBDIR)/$$i; \
1011 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1012 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1013 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
1014 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
1016 then true; else exit 1; fi; \
1020 # Here are the targets which correspond to the do-X targets.
1022 .PHONY: info installcheck dvi install-info
1023 .PHONY: clean distclean mostlyclean maintainer-clean realclean
1024 .PHONY: local-clean local-distclean local-maintainer-clean
1026 installcheck: do-installcheck
1029 # Make sure makeinfo is built before we do a `make info'.
1030 do-info: all-texinfo
1032 install-info: do-install-info dir.info
1033 s=`cd $(srcdir); pwd`; export s; \
1034 if [ -f dir.info ] ; then \
1035 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
1039 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
1042 -rm -f Makefile config.status config.cache mh-frag mt-frag
1043 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
1044 rm -rf $(TARGET_SUBDIR); \
1046 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
1047 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
1048 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
1049 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
1050 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
1052 local-maintainer-clean:
1053 @echo "This command is intended for maintainers to use;"
1054 @echo "it deletes files that may require special tools to rebuild."
1056 clean: do-clean local-clean
1057 mostlyclean: do-mostlyclean local-clean
1058 distclean: do-distclean local-clean local-distclean
1059 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
1060 maintainer-clean: local-distclean
1061 realclean: maintainer-clean
1063 # This rule is used to clean specific modules.
1064 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
1065 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
1066 @dir=`echo $@ | sed -e 's/clean-//'`; \
1067 if [ -f ./$${dir}/Makefile ] ; then \
1068 r=`pwd`; export r; \
1069 s=`cd $(srcdir); pwd`; export s; \
1071 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
1076 .PHONY: $(CLEAN_TARGET_MODULES)
1077 $(CLEAN_TARGET_MODULES):
1078 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
1079 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1080 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1081 r=`pwd`; export r; \
1082 s=`cd $(srcdir); pwd`; export s; \
1084 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
1089 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
1090 clean-target-libgcc:
1091 test ! -d gcc/libgcc || \
1092 (cd gcc/libgcc && find . -type d -print) | \
1093 while read d; do rm -f gcc/$$d/libgcc.a || : ; done
1099 check: $(CHECK_MODULES) \
1100 $(CHECK_TARGET_MODULES) \
1101 $(CHECK_X11_MODULES) \
1104 # Automated reporting of test results.
1106 warning.log: build.log
1107 $(srcdir)/contrib/warn_summary build.log > $@
1110 if test x'$(BOOT_CFLAGS)' != x''; then \
1111 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1113 $(srcdir)/contrib/test_summary -t >$@
1115 echo If you really want to send e-mail, run ./$@ now
1117 mail-report-with-warnings.log: warning.log
1118 if test x'$(BOOT_CFLAGS)' != x''; then \
1119 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1121 $(srcdir)/contrib/test_summary -t -i warning.log >$@
1123 echo If you really want to send e-mail, run ./$@ now
1125 # Installation targets.
1127 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
1128 install: $(INSTALL_TARGET)
1129 install-cross: $(INSTALL_TARGET_CROSS)
1132 @echo "the uninstall target is not supported in this tree"
1135 $(MAKE) -f ./release/Build-A-Release \
1136 host=$(host_alias) source-vault
1139 $(MAKE) -f ./release/Build-A-Release \
1140 host=$(host_alias) target=$(target_alias)
1143 @if [ -f ./release/vault-install ] ; then \
1144 ./release/vault-install $(host_alias) $(target_alias) ; \
1150 install.all: install-no-fixedincludes
1151 @if [ -f ./gcc/Makefile ] ; then \
1152 r=`pwd` ; export r ; \
1155 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1160 # inet-install is used because the I*Net wants DejaGNU installed but
1161 # not built. Similarly, gzip is built but not installed.
1163 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1165 # install-no-fixedincludes is used because Cygnus can not distribute
1166 # the fixed header files.
1167 .PHONY: install-no-fixedincludes
1168 install-no-fixedincludes: \
1170 $(INSTALL_MODULES) \
1171 $(INSTALL_TARGET_MODULES) \
1172 $(INSTALL_X11_MODULES) \
1173 gcc-no-fixedincludes
1175 # Install the gcc headers files, but not the fixed include files,
1176 # which Cygnus is not allowed to distribute. This rule is very
1177 # dependent on the workings of the gcc Makefile.in.
1178 .PHONY: gcc-no-fixedincludes
1179 gcc-no-fixedincludes:
1180 @if [ -f ./gcc/Makefile ]; then \
1181 rm -rf gcc/tmp-include; \
1182 mv gcc/include gcc/tmp-include 2>/dev/null; \
1183 mkdir gcc/include; \
1184 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1185 touch gcc/stmp-fixinc gcc/include/fixed; \
1186 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1187 r=`pwd`; export r; \
1188 s=`cd $(srcdir); pwd` ; export s; \
1191 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1192 rm -rf gcc/include; \
1193 mv gcc/tmp-include gcc/include 2>/dev/null; \
1196 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1197 # build a target all-X means to cd to X and make all.
1199 # all-gui, and all-libproc are handled specially because
1200 # they are still experimental, and if they fail to build, that
1201 # shouldn't stop "make all".
1202 .PHONY: $(ALL_MODULES) all-gui all-libproc
1203 $(ALL_MODULES) all-gui all-libproc:
1204 @dir=`echo $@ | sed -e 's/all-//'`; \
1205 if [ -f ./$${dir}/Makefile ] ; then \
1206 r=`pwd`; export r; \
1207 s=`cd $(srcdir); pwd`; export s; \
1209 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1214 # These rules are used to check the modules which use FLAGS_TO_PASS.
1215 # To build a target check-X means to cd to X and make check. Some
1216 # modules are only tested in a native toolchain.
1218 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1219 $(NATIVE_CHECK_MODULES):
1220 @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
1221 dir=`echo $@ | sed -e 's/check-//'`; \
1222 if [ -f ./$${dir}/Makefile ] ; then \
1223 r=`pwd`; export r; \
1224 s=`cd $(srcdir); pwd`; export s; \
1226 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1232 $(CROSS_CHECK_MODULES):
1233 @dir=`echo $@ | sed -e 's/check-//'`; \
1234 if [ -f ./$${dir}/Makefile ] ; then \
1235 r=`pwd`; export r; \
1236 s=`cd $(srcdir); pwd`; export s; \
1238 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1243 # This rule is used to install the modules which use FLAGS_TO_PASS.
1244 # To build a target install-X means to cd to X and make install.
1245 .PHONY: $(INSTALL_MODULES)
1246 $(INSTALL_MODULES): installdirs
1247 @dir=`echo $@ | sed -e 's/install-//'`; \
1248 if [ -f ./$${dir}/Makefile ] ; then \
1249 r=`pwd`; export r; \
1250 s=`cd $(srcdir); pwd`; export s; \
1252 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1257 # This rule is used to configure the modules which are built with the
1259 .PHONY: $(CONFIGURE_TARGET_MODULES)
1260 $(CONFIGURE_TARGET_MODULES):
1261 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1262 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1263 r=`pwd`; export r; \
1264 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1265 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1266 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1267 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1268 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1270 echo "Multilibs changed for $${dir}, reconfiguring"; \
1271 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1272 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1275 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1278 fi; exit 0 # break command into two pieces
1279 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1280 if [ ! -d $(TARGET_SUBDIR) ]; then \
1282 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1284 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1285 if [ -d $(srcdir)/$${dir} ]; then \
1286 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1287 r=`pwd`; export r; \
1288 s=`cd $(srcdir); pwd`; export s; \
1290 AR="$(AR_FOR_TARGET)"; export AR; \
1291 AS="$(AS_FOR_TARGET)"; export AS; \
1292 CC="$(CC_FOR_TARGET)"; export CC; \
1293 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1294 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1295 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1296 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1297 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1298 LD="$(LD_FOR_TARGET)"; export LD; \
1299 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1300 NM="$(NM_FOR_TARGET)"; export NM; \
1301 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1302 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1303 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1304 cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \
1306 /* | [A-Za-z]:[\\/]*) \
1307 topdir=$(srcdir) ;; \
1309 case "$(TARGET_SUBDIR)" in \
1310 .) topdir="../$(srcdir)" ;; \
1311 *) topdir="../../$(srcdir)" ;; \
1314 if [ "$(srcdir)" = "." ] ; then \
1315 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1316 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1317 if [ -f Makefile ]; then \
1318 if $(MAKE) distclean; then \
1332 srcdiroption="--srcdir=."; \
1335 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1336 libsrcdir="$$s/$${dir}"; \
1338 if [ -f $${libsrcdir}/configure ] ; then \
1339 rm -f no-such-file skip-this-dir; \
1340 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1341 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1342 --with-target-subdir="$(TARGET_SUBDIR)"; \
1344 rm -f no-such-file skip-this-dir; \
1345 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1346 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1347 --with-target-subdir="$(TARGET_SUBDIR)"; \
1349 if [ -f skip-this-dir ] ; then \
1351 rm -f skip-this-dir; \
1352 cd ..; rmdir $${dir} || true; \
1363 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1364 # To build a target all-X means to cd to X and make all.
1365 .PHONY: $(ALL_TARGET_MODULES)
1366 $(ALL_TARGET_MODULES):
1367 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1368 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1369 r=`pwd`; export r; \
1370 s=`cd $(srcdir); pwd`; export s; \
1372 (cd $(TARGET_SUBDIR)/$${dir}; \
1373 $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1378 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1379 # To build a target install-X means to cd to X and make install.
1380 .PHONY: $(CHECK_TARGET_MODULES)
1381 $(CHECK_TARGET_MODULES):
1382 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1383 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1384 r=`pwd`; export r; \
1385 s=`cd $(srcdir); pwd`; export s; \
1387 (cd $(TARGET_SUBDIR)/$${dir}; \
1388 $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1393 # This rule is used to install the modules which use
1394 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1396 .PHONY: $(INSTALL_TARGET_MODULES)
1397 $(INSTALL_TARGET_MODULES): installdirs
1398 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1399 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1400 r=`pwd`; export r; \
1401 s=`cd $(srcdir); pwd`; export s; \
1403 (cd $(TARGET_SUBDIR)/$${dir}; \
1404 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1409 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1410 # To build a target all-X means to cd to X and make all.
1411 .PHONY: $(ALL_X11_MODULES)
1413 @dir=`echo $@ | sed -e 's/all-//'`; \
1414 if [ -f ./$${dir}/Makefile ] ; then \
1415 r=`pwd`; export r; \
1416 s=`cd $(srcdir); pwd`; export s; \
1419 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1424 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1425 # To build a target check-X means to cd to X and make all.
1426 .PHONY: $(CHECK_X11_MODULES)
1427 $(CHECK_X11_MODULES):
1428 @dir=`echo $@ | sed -e 's/check-//'`; \
1429 if [ -f ./$${dir}/Makefile ] ; then \
1430 r=`pwd`; export r; \
1431 s=`cd $(srcdir); pwd`; export s; \
1434 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1439 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1440 # To build a target install-X means to cd to X and make install.
1441 .PHONY: $(INSTALL_X11_MODULES)
1442 $(INSTALL_X11_MODULES): installdirs
1443 @dir=`echo $@ | sed -e 's/install-//'`; \
1444 if [ -f ./$${dir}/Makefile ] ; then \
1445 r=`pwd`; export r; \
1446 s=`cd $(srcdir); pwd`; export s; \
1449 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1454 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1457 @if [ -f ./gcc/Makefile ] ; then \
1458 r=`pwd`; export r; \
1459 s=`cd $(srcdir); pwd`; export s; \
1461 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1466 # Building GCC uses some tools for rebuilding "source" files
1467 # like texinfo, bison/byacc, etc. So we must depend on those.
1469 # While building GCC, it may be necessary to run various target
1470 # programs like the assembler, linker, etc. So we depend on
1473 # In theory, on an SMP all those dependencies can be resolved
1476 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1477 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
1478 @r=`pwd`; export r; \
1479 s=`cd $(srcdir); pwd`; export s; \
1481 echo "Bootstrapping the compiler"; \
1482 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1483 @r=`pwd`; export r; \
1484 s=`cd $(srcdir); pwd`; export s; \
1486 *bootstrap4-lean ) \
1487 msg="Comparing stage3 and stage4 of the compiler"; \
1488 compare=compare3-lean ;; \
1489 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1490 compare=compare3 ;; \
1491 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1492 compare=compare-lean ;; \
1493 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1494 compare=compare ;; \
1498 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1499 @r=`pwd`; export r; \
1500 s=`cd $(srcdir); pwd` ; export s; \
1502 echo "Building runtime libraries"; \
1503 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1506 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1507 @r=`pwd`; export r; \
1508 s=`cd $(srcdir); pwd`; export s; \
1510 echo "Building the C and C++ compiler"; \
1511 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1512 @r=`pwd`; export r; \
1513 s=`cd $(srcdir); pwd` ; export s; \
1515 echo "Building runtime libraries"; \
1516 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1517 LANGUAGES="c c++" all
1521 @if [ -f ./gcc/Makefile ] ; then \
1522 r=`pwd`; export r; \
1523 s=`cd $(srcdir); pwd`; export s; \
1525 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1532 @if [ -f ./gcc/Makefile ] ; then \
1533 r=`pwd`; export r; \
1534 s=`cd $(srcdir); pwd`; export s; \
1536 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1537 $(MAKE) check-target-libstdc++-v3; \
1544 @if [ -f ./gcc/Makefile ] ; then \
1545 r=`pwd`; export r; \
1546 s=`cd $(srcdir); pwd`; export s; \
1548 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1553 .PHONY: install-gcc-cross
1555 @if [ -f ./gcc/Makefile ] ; then \
1556 r=`pwd`; export r; \
1557 s=`cd $(srcdir); pwd`; export s; \
1559 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1563 # EXPERIMENTAL STUFF
1564 # This rule is used to install the modules which use FLAGS_TO_PASS.
1565 # To build a target install-X means to cd to X and make install.
1566 .PHONY: install-dosrel
1567 install-dosrel: installdirs info
1568 @dir=`echo $@ | sed -e 's/install-//'`; \
1569 if [ -f ./$${dir}/Makefile ] ; then \
1570 r=`pwd`; export r; \
1571 s=`cd $(srcdir); pwd`; export s; \
1573 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1578 install-dosrel-fake:
1581 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1582 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1584 # This is a list of inter-dependencies among modules.
1587 all-autoconf: all-m4 all-texinfo
1588 all-automake: all-m4 all-texinfo
1590 all-bfd: all-libiberty all-intl
1591 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1592 all-bison: all-texinfo
1593 configure-target-boehm-gc: $(ALL_GCC_CXX) configure-target-qthreads
1594 all-target-boehm-gc: configure-target-boehm-gc
1595 configure-target-bsp: $(ALL_GCC_C)
1596 all-target-bsp: configure-target-bsp
1599 all-cgen: all-libiberty
1601 configure-target-cygmon: $(ALL_GCC_C)
1602 all-target-cygmon: configure-target-cygmon all-target-libiberty all-target-libstub all-target-bsp
1604 all-dejagnu: all-tcl all-expect all-tk
1605 all-diff: all-libiberty
1607 all-emacs19: all-bison all-byacc
1609 configure-target-examples: $(ALL_GCC_C)
1610 all-target-examples: configure-target-examples
1611 all-expect: all-tcl all-tk
1612 all-fileutils: all-libiberty
1615 all-flex: all-libiberty all-bison all-byacc
1616 all-gas: all-libiberty all-opcodes all-bfd all-intl
1619 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
1620 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1621 GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
1622 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1625 configure-target-gperf: $(ALL_GCC_CXX)
1626 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3
1627 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1628 all-grep: all-libiberty
1629 all-grez: all-libiberty all-bfd all-opcodes
1630 all-gui: all-gdb all-libproc all-target-librx
1632 all-gzip: all-libiberty
1633 all-hello: all-libiberty
1635 all-inet: all-tcl all-send-pr all-perl
1637 all-ispell: all-emacs19
1638 all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1
1639 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1640 configure-target-libgloss: $(ALL_GCC)
1641 all-target-libgloss: configure-target-libgloss configure-target-newlib
1642 all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
1644 configure-target-libffi: $(ALL_GCC_C)
1645 all-target-libffi: configure-target-libffi
1646 configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1647 all-target-libjava: configure-target-libjava all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1648 configure-target-librx: $(ALL_GCC_C)
1649 all-target-librx: configure-target-librx
1650 configure-target-libstdc++-v3: $(ALL_GCC_C)
1651 all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty
1652 configure-target-libstub: $(ALL_GCC_C)
1653 all-target-libstub: configure-target-libstub
1655 configure-target-libf2c: $(ALL_GCC_C)
1656 all-target-libf2c: configure-target-libf2c all-target-libiberty
1657 configure-target-libchill: $(ALL_GCC_C)
1658 all-target-libchill: configure-target-libchill all-target-libiberty
1659 configure-target-libobjc: $(ALL_GCC_C)
1660 all-target-libobjc: configure-target-libobjc all-target-libiberty
1661 all-m4: all-libiberty all-texinfo
1662 all-make: all-libiberty
1664 configure-target-newlib: $(ALL_GCC)
1665 all-target-newlib: configure-target-newlib
1666 configure-target-libtermcap: $(ALL_GCC_C)
1667 all-target-libtermcap: configure-target-libtermcap
1668 all-opcodes: all-bfd all-libiberty all-cgen
1669 all-patch: all-libiberty
1671 all-prms: all-libiberty
1672 configure-target-qthreads: $(ALL_GCC_C)
1673 all-target-qthreads: configure-target-qthreads
1676 all-recode: all-libiberty
1677 all-sed: all-libiberty
1678 all-send-pr: all-prms
1680 all-sid: all-tcl all-tk
1681 all-sim: all-libiberty all-bfd all-opcodes all-readline all-cgen
1682 all-snavigator: all-tcl all-tk all-itcl all-db all-grep all-libgui
1683 all-tar: all-libiberty
1686 all-tclX: all-tcl all-tk
1688 all-tk8.1: all-tcl8.1
1689 all-texinfo: all-libiberty
1691 all-tgas: all-libiberty all-bfd all-opcodes
1693 all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1
1695 configure-target-winsup: $(ALL_GCC_C)
1696 all-target-winsup: all-target-libiberty all-target-libtermcap configure-target-winsup
1697 all-uudecode: all-libiberty
1700 configure-target-zlib: $(ALL_GCC_C)
1701 all-target-zlib: configure-target-zlib
1702 all-fastjar: all-zlib
1703 configure-target-fastjar: configure-target-zlib
1704 all-target-fastjar: configure-target-fastjar all-target-zlib
1705 configure-target-libiberty: $(ALL_GCC_C)
1706 all-target-libiberty: configure-target-libiberty
1707 all-target: $(ALL_TARGET_MODULES)
1708 install-target: $(INSTALL_TARGET_MODULES)
1709 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1710 install-sid: install-tcl install-tk
1711 ### other supporting targets
1717 installdirs: mkinstalldirs
1718 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1720 dir.info: do-install-info
1721 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1722 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1723 mv -f dir.info.new dir.info ; \
1728 @echo "Building a full distribution of this tree isn't done"
1729 @echo "via 'make dist'. Check out the etc/ subdirectory"
1733 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1734 # ability to use several tags files at once, so there is probably no need
1735 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1736 # (if we felt like it) have this Makefile write a piece of elisp which
1737 # the user could load to tell emacs19 where all the TAGS files we just
1741 # with the gnu make, this is done automatically.
1743 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1744 $(SHELL) ./config.status
1747 # Support for building net releases
1749 # Files in devo used in any net release.
1750 # ChangeLog omitted because it may refer to files which are not in this
1751 # distribution (perhaps it would be better to include it anyway).
1752 DEVO_SUPPORT= README Makefile.in configure configure.in \
1753 config.guess config.if config.sub config move-if-change \
1754 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1755 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1756 mkinstalldirs ltconfig ltmain.sh missing ylwrap \
1757 libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
1759 # Files in devo/etc used in any net release.
1760 # ChangeLog omitted because it may refer to files which are not in this
1761 # distribution (perhaps it would be better to include it anyway).
1762 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1763 make-stds.texi standards.info*
1765 # When you use `make setup-dirs' or `make taz' you should always redefine
1767 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1769 # NOTE: No double quotes in the below. It is used within shell script
1771 VER = ` if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1772 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1774 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1779 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1780 $(MAKE) -f Makefile.in do-proto-toplev \
1781 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1782 MD5PROG="$(MD5PROG)" \
1783 SUPPORT_FILES="$(SUPPORT_FILES)"
1784 $(MAKE) -f Makefile.in do-md5sum \
1785 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1786 MD5PROG="$(MD5PROG)" \
1787 SUPPORT_FILES="$(SUPPORT_FILES)"
1788 $(MAKE) -f Makefile.in do-tar-bz2 \
1789 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1790 MD5PROG="$(MD5PROG)" \
1791 SUPPORT_FILES="$(SUPPORT_FILES)"
1794 gdb-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1795 $(MAKE) -f Makefile.in do-proto-toplev \
1796 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1797 MD5PROG="$(MD5PROG)" \
1798 SUPPORT_FILES="$(SUPPORT_FILES)"
1799 $(MAKE) -f Makefile.in do-md5sum \
1800 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1801 MD5PROG="$(MD5PROG)" \
1802 SUPPORT_FILES="$(SUPPORT_FILES)"
1803 $(MAKE) -f Makefile.in do-djunpack \
1804 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1805 MD5PROG="$(MD5PROG)" \
1806 SUPPORT_FILES="$(SUPPORT_FILES)"
1807 $(MAKE) -f Makefile.in do-tar-bz2 \
1808 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1809 MD5PROG="$(MD5PROG)" \
1810 SUPPORT_FILES="$(SUPPORT_FILES)"
1812 .PHONY: do-proto-toplev
1813 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1814 echo "==> Making $(PACKAGE)-$(VER)/"
1815 # Take out texinfo from a few places.
1816 sed -e '/^all\.normal: /s/\all-texinfo //' \
1817 -e '/^ install-texinfo /d' \
1819 mv -f tmp Makefile.in
1822 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1823 || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
1824 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
1825 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1826 # Make links, and run "make diststuff" or "make info" when needed.
1827 rm -rf proto-toplev ; mkdir proto-toplev
1828 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1829 for d in $$dirs ; do \
1830 if [ -d $$d ]; then \
1831 if [ ! -f $$d/Makefile ] ; then true ; \
1832 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1833 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1834 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1835 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1837 if [ -d $$d/proto-$$d.dir ]; then \
1838 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1840 ln -s ../$$d proto-toplev/$$d ; \
1842 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1844 cd etc && $(MAKE) info
1847 mkdir proto-toplev/etc
1848 (cd proto-toplev/etc; \
1849 for i in $(ETC_SUPPORT); do \
1850 ln -s ../../etc/$$i . ; \
1853 # Take out texinfo from configurable dirs
1854 rm proto-toplev/configure.in
1855 sed -e '/^host_tools=/s/texinfo //' \
1856 <configure.in >proto-toplev/configure.in
1858 mkdir proto-toplev/texinfo
1859 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1860 if test -r texinfo/util/tex3patch ; then \
1861 mkdir proto-toplev/texinfo/util && \
1862 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1864 chmod -R og=u . || chmod og=u `find . -print`
1866 -rm -f $(PACKAGE)-$(VER)
1867 ln -s proto-toplev $(PACKAGE)-$(VER)
1871 echo "==> Making $(PACKAGE)-$(VER).tar.bz2"
1872 -rm -f $(PACKAGE)-$(VER).tar.bz2
1873 find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
1874 | tar cTfh - $(PACKAGE)-$(VER).tar
1875 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1879 echo "==> Adding md5 checksum to top-level directory"
1880 cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
1881 | xargs $(MD5PROG) > ../md5.sum
1882 mv md5.sum proto-toplev
1886 echo "==> Adding updated djunpack.bat to top-level directory"
1887 echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1888 sed < djunpack.bat > djunpack.new \
1889 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1890 mv djunpack.new djunpack.bat
1891 -rm -f proto-toplev/djunpack.bat
1892 ln -s ../djunpack.bat proto-toplev/djunpack.bat
1894 TEXINFO_SUPPORT= texinfo/texinfo.tex
1895 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1898 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1899 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1900 $(MAKE) -f Makefile.in taz TOOL=gas \
1901 MD5PROG="$(MD5PROG)" \
1902 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1904 # The FSF "binutils" release includes gprof and ld.
1905 .PHONY: binutils.tar.bz2
1906 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1907 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1908 $(MAKE) -f Makefile.in taz TOOL=binutils \
1909 MD5PROG="$(MD5PROG)" \
1910 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1912 .PHONY: gas+binutils.tar.bz2
1913 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1914 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1915 $(MAKE) -f Makefile.in taz TOOL=gas \
1916 MD5PROG="$(MD5PROG)" \
1917 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1919 GNATS_SUPPORT_DIRS=include libiberty send-pr
1920 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1921 $(MAKE) -f Makefile.in taz TOOL=gnats \
1922 MD5PROG="$(MD5PROG)" \
1923 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1926 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
1927 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1928 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
1929 MD5PROG="$(MD5PROG)" \
1930 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1932 .PHONY: dejagnu.tar.bz2
1933 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
1934 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
1935 $(MAKE) -f Makefile.in taz TOOL=dejagnu \
1936 MD5PROG="$(MD5PROG)" \
1937 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
1939 .PHONY: gdb+dejagnu.tar.bz2
1940 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
1941 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1942 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
1943 MD5PROG="$(MD5PROG)" \
1944 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1946 .PHONY: insight.tar.bz2
1947 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
1948 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1949 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
1950 MD5PROG="$(MD5PROG)" \
1951 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1953 .PHONY: insight+dejagnu.tar.bz2
1954 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
1955 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1956 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
1957 MD5PROG="$(MD5PROG)" \
1958 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1960 .PHONY: newlib.tar.bz2
1961 NEWLIB_SUPPORT_DIRS=libgloss
1962 # taz configures for the sun4 target which won't configure newlib.
1963 # We need newlib configured so that the .info files are made.
1964 # Unfortunately, it is not enough to just configure newlib separately:
1965 # taz will build the .info files but since SUBDIRS won't contain newlib,
1966 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1967 # used in building the .info files, eg: *.def, *.ref).
1968 # The problem isn't solvable however without a lot of extra work because
1969 # target libraries are built in subdir $(target_alias) which gets nuked during
1970 # the make distclean. For now punt on the issue of shipping newlib info files
1971 # with newlib net releases and wait for a day when some native target (sun4?)
1972 # supports newlib (if only minimally).
1973 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1974 $(MAKE) -f Makefile.in taz TOOL=newlib \
1975 MD5PROG="$(MD5PROG)" \
1976 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1977 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1982 # end of Makefile.in