2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
4 # 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_TARGET = $(CFLAGS)
92 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
96 CHILLFLAGS = $(CFLAGS)
100 # Use -O2 to stress test the compiler.
101 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
102 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
103 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
117 # These values are substituted by configure.
122 BISON = `if [ -f $$r/bison/bison ] ; then \
123 echo $$r/bison/bison -L $$s/bison/ ; \
128 YACC = `if [ -f $$r/bison/bison ] ; then \
129 echo $$r/bison/bison -y -L $$s/bison/ ; \
130 elif [ -f $$r/byacc/byacc ] ; then \
131 echo $$r/byacc/byacc ; \
133 echo ${DEFAULT_YACC} ; \
136 LEX = `if [ -f $$r/flex/flex ] ; \
137 then echo $$r/flex/flex ; \
138 else echo ${DEFAULT_LEX} ; fi`
140 M4 = `if [ -f $$r/m4/m4 ] ; \
141 then echo $$r/m4/m4 ; \
142 else echo ${DEFAULT_M4} ; fi`
144 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
145 then echo $$r/texinfo/makeinfo/makeinfo ; \
146 else echo makeinfo ; fi`
148 # This just becomes part of the MAKEINFO definition passed down to
149 # sub-makes. It lets flags be given on the command line while still
150 # using the makeinfo from the object tree.
153 EXPECT = `if [ -f $$r/expect/expect ] ; \
154 then echo $$r/expect/expect ; \
155 else echo expect ; fi`
157 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
158 then echo $$s/dejagnu/runtest ; \
159 else echo runtest ; fi`
162 # compilers to use to create programs which must be run in the build
165 CXX_FOR_BUILD = $(CXX)
167 SUBDIRS = "this is set via configure, don't edit this"
170 # This is set by the configure script to the list of directories which
171 # should be built using the target tools.
172 TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon libf2c libchill libobjc
174 # Target libraries are put under this directory:
175 # Changed by configure to $(target_alias) if cross.
178 # This is set by the configure script to the arguments passed to configure.
181 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
185 # This is the name of the environment variable used for the path to
186 # the libraries. This may be changed by configure.in.
187 RPATH_ENVVAR = LD_LIBRARY_PATH
189 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
190 REALLY_SET_LIB_PATH = \
191 if [ x"$$$(RPATH_ENVVAR)" != x ]; then \
192 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
194 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes; \
196 export $(RPATH_ENVVAR);
199 INSTALL_TARGET = installdirs \
202 $(INSTALL_TARGET_MODULES) \
203 $(INSTALL_X11_MODULES) \
206 INSTALL_TARGET_CROSS = installdirs \
209 $(INSTALL_TARGET_MODULES) \
210 $(INSTALL_X11_MODULES) \
214 if [ -f $$r/gcc/xgcc ] ; then \
215 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
216 case "$(target_canonical)" in \
217 i[3456]86-*-cygwin*) \
218 echo $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$$r/gcc/ -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/winsup/cygwin/include -idirafter $$s/winsup/w32api/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \
221 echo $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
225 echo $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -isystem $(build_tooldir)/include; \
228 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
231 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
235 # If CC_FOR_TARGET is not overriden on the command line, then this
236 # variable is passed down to the gcc Makefile, where it is used to
237 # build libgcc2.a. We define it here so that it can itself be
238 # overridden on the command line.
239 GCC_FOR_TARGET = $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -isystem $(build_tooldir)/include
241 CHILL_FOR_TARGET = ` \
242 if [ -f $$r/gcc/xgcc ] ; then \
243 echo $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
245 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
248 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
253 if [ -f $$r/gcc/g++ ] ; then \
254 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
255 case "$(target_canonical)" in \
256 i[3456]86-*-cygwin*) \
257 echo $$r/gcc/g++ -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$$r/gcc/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/cygwin/include -idirafter $$s/winsup/w32api/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc -L$$r/$(TARGET_SUBDIR)/libstdc++; \
260 echo $$r/gcc/g++ -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc -L$$r/$(TARGET_SUBDIR)/libstdc++; \
264 echo $$r/gcc/g++ -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -isystem $(build_tooldir)/include -L$$r/$(TARGET_SUBDIR)/libstdc++; \
267 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
270 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
275 if [ -f $$r/gas/as-new ] ; then \
276 echo $$r/gas/as-new ; \
278 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
281 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
286 if [ -f $$r/ld/ld-new ] ; then \
287 echo $$r/ld/ld-new ; \
289 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
292 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
296 DLLTOOL_FOR_TARGET = ` \
297 if [ -f $$r/binutils/dlltool ] ; then \
298 echo $$r/binutils/dlltool ; \
300 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
303 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
307 WINDRES_FOR_TARGET = ` \
308 if [ -f $$r/binutils/windres ] ; then \
309 echo $$r/binutils/windres ; \
311 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
314 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
319 if [ -f $$r/binutils/ar ] ; then \
320 echo $$r/binutils/ar ; \
322 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
325 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
329 RANLIB_FOR_TARGET = ` \
330 if [ -f $$r/binutils/ranlib ] ; then \
331 echo $$r/binutils/ranlib ; \
333 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
336 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
341 if [ -f $$r/binutils/nm-new ] ; then \
342 echo $$r/binutils/nm-new ; \
344 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
347 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
351 # The first rule in the file had better be this one. Don't put any above it.
352 # This lives here to allow makefile fragments to contain dependencies.
356 # These can be overridden by config/mt-*.
357 # The _TARGET_ is because they're specified in mt-foo.
358 # The _HOST_ is because they're programs that run on the host.
359 EXTRA_TARGET_HOST_ALL_MODULES =
360 EXTRA_TARGET_HOST_INSTALL_MODULES =
361 EXTRA_TARGET_HOST_CHECK_MODULES =
363 #### host and target specific makefile fragments come in here.
366 # Flags to pass down to all sub-makes.
367 # Please keep these in alphabetical order.
368 BASE_FLAGS_TO_PASS = \
369 "AR_FLAGS=$(AR_FLAGS)" \
370 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
371 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
373 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
374 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
376 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
377 "CHILLFLAGS=$(CHILLFLAGS)" \
378 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
379 "CHILL_LIB=$(CHILL_LIB)" \
380 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
381 "CXXFLAGS=$(CXXFLAGS)" \
382 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
383 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
384 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
385 "INSTALL=$(INSTALL)" \
386 "INSTALL_DATA=$(INSTALL_DATA)" \
387 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
388 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
389 "LDFLAGS=$(LDFLAGS)" \
391 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
392 "LIBCFLAGS=$(LIBCFLAGS)" \
393 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
394 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
395 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
398 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
399 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
400 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
401 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
404 "RUNTEST=$(RUNTEST)" \
405 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
406 "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
407 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
410 "datadir=$(datadir)" \
411 "exec_prefix=$(exec_prefix)" \
412 "includedir=$(includedir)" \
413 "infodir=$(infodir)" \
415 "libexecdir=$(libexecdir)" \
416 "lispdir=$(lispdir)" \
417 "localstatedir=$(localstatedir)" \
419 "oldincludedir=$(oldincludedir)" \
421 "sbindir=$(sbindir)" \
422 "sharedstatedir=$(sharedstatedir)" \
423 "sysconfdir=$(sysconfdir)" \
424 "tooldir=$(tooldir)" \
425 "build_tooldir=$(build_tooldir)" \
426 "gxx_include_dir=$(gxx_include_dir)" \
427 "gcc_version=$(gcc_version)" \
428 "gcc_version_trigger=$(gcc_version_trigger)" \
429 "target_alias=$(target_alias)" \
430 "libsubdir=$(libsubdir)"
432 # Flags to pass down to most sub-makes, in which we're building with
433 # the host environment.
434 # If any variables are added here, they must be added to do-*, below.
440 'DLLTOOL=$(DLLTOOL)' \
446 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
448 # Flags that are concerned with the location of the X11 include files
451 # NOTE: until the top-level is getting the values via autoconf, it only
452 # causes problems to have this top-level Makefile overriding the autoconf-set
453 # values in child directories. Only variables that don't conflict with
454 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
456 X11_FLAGS_TO_PASS = \
457 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
458 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
460 # Flags to pass down to makes which are built with the target environment.
461 # The double $ decreases the length of the command line; the variables
462 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
463 # If any variables are added here, they must be added to do-*, below.
464 EXTRA_TARGET_FLAGS = \
465 'AR=$$(AR_FOR_TARGET)' \
466 'AS=$$(AS_FOR_TARGET)' \
467 'CC=$$(CC_FOR_TARGET)' \
468 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
469 'CXX=$$(CXX_FOR_TARGET)' \
470 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
471 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
472 'LD=$$(LD_FOR_TARGET)' \
473 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
474 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
475 'NM=$$(NM_FOR_TARGET)' \
476 'RANLIB=$$(RANLIB_FOR_TARGET)' \
477 'WINDRES=$$(WINDRES_FOR_TARGET)'
479 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
481 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
482 # unfortunately needs the native compiler and the target ar and
484 # If any variables are added here, they must be added to do-*, below.
485 # The HOST_* variables are a special case, which are used for the gcc
486 # cross-building scheme.
492 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
493 'HOST_CC=$(CC_FOR_BUILD)' \
494 'HOST_PREFIX=$(HOST_PREFIX)' \
495 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
498 'WINDRES=$$(WINDRES_FOR_TARGET)' \
499 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
500 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
501 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
502 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
503 "`echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)' | sed -e s/.*=$$/XFOO=/`" \
504 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
505 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
506 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
507 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
508 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
510 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
512 # This is a list of the targets for all of the modules which are compiled
513 # using $(FLAGS_TO_PASS).
579 $(EXTRA_TARGET_HOST_ALL_MODULES)
581 # This is a list of the check targets for all of the modules which are
582 # compiled using $(FLAGS_TO_PASS).
584 # The list is in two parts. The first lists those tools which
585 # are tested as part of the host's native tool-chain, and not
586 # tested in a cross configuration.
587 NATIVE_CHECK_MODULES = \
593 CROSS_CHECK_MODULES = \
650 $(EXTRA_TARGET_HOST_CHECK_MODULES)
652 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
654 # This is a list of the install targets for all of the modules which are
655 # compiled using $(FLAGS_TO_PASS).
656 # We put install-opcodes before install-binutils because the installed
657 # binutils might be on PATH, and they might need the shared opcodes
659 # We put install-tcl before install-itcl because itcl wants to run a
660 # program on installation which uses the Tcl libraries.
724 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
726 # This is a list of the targets for all of the modules which are compiled
727 # using $(X11_FLAGS_TO_PASS).
740 # This is a list of the check targets for all of the modules which are
741 # compiled using $(X11_FLAGS_TO_PASS).
742 CHECK_X11_MODULES = \
752 # This is a list of the install targets for all the modules which are
753 # compiled using $(X11_FLAGS_TO_PASS).
754 INSTALL_X11_MODULES = \
766 # This is a list of the targets for all of the modules which are compiled
767 # using $(TARGET_FLAGS_TO_PASS).
768 ALL_TARGET_MODULES = \
770 all-target-libstdc++ \
771 all-target-libstdc++-v3 \
776 all-target-libchill \
778 all-target-libtermcap \
780 all-target-libgloss \
781 all-target-libiberty \
783 all-target-examples \
788 all-target-boehm-gc \
789 all-target-qthreads \
793 # This is a list of the configure targets for all of the modules which
794 # are compiled using the target tools.
795 CONFIGURE_TARGET_MODULES = \
796 configure-target-libio \
797 configure-target-libstdc++ \
798 configure-target-libstdc++-v3 \
799 configure-target-librx \
800 configure-target-libg++ \
801 configure-target-newlib \
802 configure-target-libf2c \
803 configure-target-libchill \
804 configure-target-libobjc \
805 configure-target-libtermcap \
806 configure-target-winsup \
807 configure-target-libgloss \
808 configure-target-libiberty \
809 configure-target-gperf \
810 configure-target-examples \
811 configure-target-libstub \
812 configure-target-libffi \
813 configure-target-libjava \
814 configure-target-zlib \
815 configure-target-boehm-gc \
816 configure-target-qthreads \
817 configure-target-bsp \
818 configure-target-cygmon
820 # This is a list of the check targets for all of the modules which are
821 # compiled using $(TARGET_FLAGS_TO_PASS).
822 CHECK_TARGET_MODULES = \
824 check-target-libstdc++ \
825 check-target-libstdc++-v3 \
826 check-target-libg++ \
827 check-target-newlib \
828 check-target-libf2c \
829 check-target-libchill \
830 check-target-libobjc \
831 check-target-winsup \
832 check-target-libiberty \
833 check-target-libffi \
834 check-target-libjava \
836 check-target-boehm-gc \
837 check-target-qthreads \
840 # This is a list of the install targets for all of the modules which are
841 # compiled using $(TARGET_FLAGS_TO_PASS).
842 INSTALL_TARGET_MODULES = \
843 install-target-libio \
844 install-target-libstdc++ \
845 install-target-libstdc++-v3 \
846 install-target-libg++ \
847 install-target-newlib \
848 install-target-libf2c \
849 install-target-libchill \
850 install-target-libobjc \
851 install-target-libtermcap \
852 install-target-winsup \
853 install-target-libgloss \
854 install-target-libiberty \
856 install-target-libjava \
857 install-target-zlib \
858 install-target-boehm-gc \
859 install-target-qthreads \
862 # This is a list of the targets for which we can do a clean-{target}.
928 # All of the target modules that can be cleaned
929 CLEAN_TARGET_MODULES = \
931 clean-target-libstdc++ \
932 clean-target-libstdc++-v3 \
934 clean-target-libg++ \
935 clean-target-newlib \
936 clean-target-libf2c \
937 clean-target-libchill \
938 clean-target-libobjc \
939 clean-target-winsup \
940 clean-target-libgloss \
941 clean-target-libiberty \
943 clean-target-examples \
944 clean-target-libstub \
945 clean-target-libffi \
946 clean-target-libjava \
948 clean-target-boehm-gc \
949 clean-target-qthreads \
953 # All of the x11 modules that can be cleaned
954 CLEAN_X11_MODULES = \
965 # The target built for a native build.
970 $(ALL_TARGET_MODULES) \
973 # Do a target for all the subdirectories. A ``make do-X'' will do a
974 # ``make X'' in all subdirectories (because, in general, there is a
975 # dependency (below) of X upon do-X, a ``make X'' will also do this,
976 # but it may do additional work as well).
977 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
978 # because it is so large that it can easily overflow the command line
979 # length limit on some systems.
988 do-maintainer-clean \
992 @target=`echo $@ | sed -e 's/^do-//'`; \
994 s=`cd $(srcdir); pwd`; export s; \
996 for i in $(SUBDIRS) -dummy-; do \
997 if [ -f ./$$i/Makefile ]; then \
1000 for flag in $(EXTRA_GCC_FLAGS); do \
1001 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
1005 for flag in $(EXTRA_HOST_FLAGS); do \
1006 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
1010 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
1012 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1013 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1014 "RANLIB=$${RANLIB}" \
1015 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
1017 then true; else exit 1; fi; \
1020 @target=`echo $@ | sed -e 's/^do-//'`; \
1021 r=`pwd`; export r; \
1022 s=`cd $(srcdir); pwd`; export s; \
1024 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
1025 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
1026 for flag in $(EXTRA_TARGET_FLAGS); do \
1027 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
1029 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
1030 if (cd $(TARGET_SUBDIR)/$$i; \
1031 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1032 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1033 "RANLIB=$${RANLIB}" \
1034 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
1036 then true; else exit 1; fi; \
1040 # Here are the targets which correspond to the do-X targets.
1042 .PHONY: info installcheck dvi install-info
1043 .PHONY: clean distclean mostlyclean maintainer-clean realclean
1044 .PHONY: local-clean local-distclean local-maintainer-clean
1046 installcheck: do-installcheck
1049 # Make sure makeinfo is built before we do a `make info'.
1050 do-info: all-texinfo
1052 install-info: do-install-info dir.info
1053 s=`cd $(srcdir); pwd`; export s; \
1054 if [ -f dir.info ] ; then \
1055 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
1059 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
1062 -rm -f Makefile config.status config.cache mh-frag mt-frag
1063 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
1064 rm -rf $(TARGET_SUBDIR); \
1067 local-maintainer-clean:
1068 @echo "This command is intended for maintainers to use;"
1069 @echo "it deletes files that may require special tools to rebuild."
1071 clean: do-clean local-clean
1072 mostlyclean: do-mostlyclean local-clean
1073 distclean: do-distclean local-clean local-distclean
1074 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
1075 maintainer-clean: local-distclean
1076 realclean: maintainer-clean
1078 # This rule is used to clean specific modules.
1079 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
1080 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
1081 @dir=`echo $@ | sed -e 's/clean-//'`; \
1082 if [ -f ./$${dir}/Makefile ] ; then \
1083 r=`pwd`; export r; \
1084 s=`cd $(srcdir); pwd`; export s; \
1086 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
1091 .PHONY: $(CLEAN_TARGET_MODULES)
1092 $(CLEAN_TARGET_MODULES):
1093 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
1094 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1095 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1096 r=`pwd`; export r; \
1097 s=`cd $(srcdir); pwd`; export s; \
1099 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
1104 clean-target: $(CLEAN_TARGET_MODULES)
1109 check: $(CHECK_MODULES) \
1110 $(CHECK_TARGET_MODULES) \
1111 $(CHECK_X11_MODULES) \
1114 # Automated reporting of test results.
1116 warning.log: build.log
1117 $(srcdir)/contrib/warn_summary build.log > $@
1120 if test x'$(BOOT_CFLAGS)' != x''; then \
1121 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1123 $(srcdir)/contrib/test_summary -t >$@
1125 echo If you really want to send e-mail, run ./$@ now
1127 mail-report-with-warnings.log: warning.log
1128 if test x'$(BOOT_CFLAGS)' != x''; then \
1129 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1131 $(srcdir)/contrib/test_summary -t -i warning.log >$@
1133 echo If you really want to send e-mail, run ./$@ now
1135 # Installation targets.
1137 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
1138 install: $(INSTALL_TARGET)
1139 install-cross: $(INSTALL_TARGET_CROSS)
1142 @echo "the uninstall target is not supported in this tree"
1145 $(MAKE) -f ./release/Build-A-Release \
1146 host=$(host_alias) source-vault
1149 $(MAKE) -f ./release/Build-A-Release \
1150 host=$(host_alias) target=$(target_alias)
1153 @if [ -f ./release/vault-install ] ; then \
1154 ./release/vault-install $(host_alias) $(target_alias) ; \
1160 install.all: install-no-fixedincludes
1161 @if [ -f ./gcc/Makefile ] ; then \
1162 r=`pwd` ; export r ; \
1165 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1170 # inet-install is used because the I*Net wants DejaGNU installed but
1171 # not built. Similarly, gzip is built but not installed.
1173 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1175 # install-no-fixedincludes is used because Cygnus can not distribute
1176 # the fixed header files.
1177 .PHONY: install-no-fixedincludes
1178 install-no-fixedincludes: \
1180 $(INSTALL_MODULES) \
1181 $(INSTALL_TARGET_MODULES) \
1182 $(INSTALL_X11_MODULES) \
1183 gcc-no-fixedincludes
1185 # Install the gcc headers files, but not the fixed include files,
1186 # which Cygnus is not allowed to distribute. This rule is very
1187 # dependent on the workings of the gcc Makefile.in.
1188 .PHONY: gcc-no-fixedincludes
1189 gcc-no-fixedincludes:
1190 @if [ -f ./gcc/Makefile ]; then \
1191 rm -rf gcc/tmp-include; \
1192 mv gcc/include gcc/tmp-include 2>/dev/null; \
1193 mkdir gcc/include; \
1194 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1195 touch gcc/stmp-fixinc gcc/include/fixed; \
1196 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1197 r=`pwd`; export r; \
1198 s=`cd $(srcdir); pwd` ; export s; \
1201 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1202 rm -rf gcc/include; \
1203 mv gcc/tmp-include gcc/include 2>/dev/null; \
1206 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1207 # build a target all-X means to cd to X and make all.
1209 # all-gui, and all-libproc are handled specially because
1210 # they are still experimental, and if they fail to build, that
1211 # shouldn't stop "make all".
1212 .PHONY: $(ALL_MODULES) all-gui all-libproc
1213 $(ALL_MODULES) all-gui all-libproc:
1214 @dir=`echo $@ | sed -e 's/all-//'`; \
1215 if [ -f ./$${dir}/Makefile ] ; then \
1216 r=`pwd`; export r; \
1217 s=`cd $(srcdir); pwd`; export s; \
1219 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1224 # These rules are used to check the modules which use FLAGS_TO_PASS.
1225 # To build a target check-X means to cd to X and make check. Some
1226 # modules are only tested in a native toolchain.
1228 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1229 $(NATIVE_CHECK_MODULES):
1230 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1231 dir=`echo $@ | sed -e 's/check-//'`; \
1232 if [ -f ./$${dir}/Makefile ] ; then \
1233 r=`pwd`; export r; \
1234 s=`cd $(srcdir); pwd`; export s; \
1236 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1242 $(CROSS_CHECK_MODULES):
1243 @dir=`echo $@ | sed -e 's/check-//'`; \
1244 if [ -f ./$${dir}/Makefile ] ; then \
1245 r=`pwd`; export r; \
1246 s=`cd $(srcdir); pwd`; export s; \
1248 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1253 # This rule is used to install the modules which use FLAGS_TO_PASS.
1254 # To build a target install-X means to cd to X and make install.
1255 .PHONY: $(INSTALL_MODULES)
1256 $(INSTALL_MODULES): installdirs
1257 @dir=`echo $@ | sed -e 's/install-//'`; \
1258 if [ -f ./$${dir}/Makefile ] ; then \
1259 r=`pwd`; export r; \
1260 s=`cd $(srcdir); pwd`; export s; \
1262 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1267 # This rule is used to configure the modules which are built with the
1269 .PHONY: $(CONFIGURE_TARGET_MODULES)
1270 $(CONFIGURE_TARGET_MODULES):
1271 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1272 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1273 r=`pwd`; export r; \
1274 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1275 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1276 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1277 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1278 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1280 echo "Multilibs changed for $${dir}, reconfiguring"; \
1281 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1282 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1285 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1288 fi; exit 0 # break command into two pieces
1289 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1290 if [ ! -d $(TARGET_SUBDIR) ]; then \
1292 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1294 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1295 if [ -d $(srcdir)/$${dir} ]; then \
1296 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1297 r=`pwd`; export r; \
1298 s=`cd $(srcdir); pwd`; export s; \
1300 AR="$(AR_FOR_TARGET)"; export AR; \
1301 AS="$(AS_FOR_TARGET)"; export AS; \
1302 CC="$(CC_FOR_TARGET)"; export CC; \
1303 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1304 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1305 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1306 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1307 LD="$(LD_FOR_TARGET)"; export LD; \
1308 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1309 NM="$(NM_FOR_TARGET)"; export NM; \
1310 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1311 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1312 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1313 cd $(TARGET_SUBDIR)/$${dir}; \
1316 topdir=$(srcdir) ;; \
1318 case "$(TARGET_SUBDIR)" in \
1319 .) topdir="../$(srcdir)" ;; \
1320 *) topdir="../../$(srcdir)" ;; \
1323 if [ "$(srcdir)" = "." ] ; then \
1324 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1325 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1326 if [ -f Makefile ]; then \
1327 if $(MAKE) distclean; then \
1341 srcdiroption="--srcdir=."; \
1344 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1345 libsrcdir="$$s/$${dir}"; \
1347 if [ -f $${libsrcdir}/configure ] ; then \
1348 rm -f no-such-file skip-this-dir; \
1349 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1350 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1351 --with-target-subdir="$(TARGET_SUBDIR)"; \
1353 rm -f no-such-file skip-this-dir; \
1354 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1355 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1356 --with-target-subdir="$(TARGET_SUBDIR)"; \
1358 if [ -f skip-this-dir ] ; then \
1360 rm -f skip-this-dir; \
1361 cd ..; rmdir $${dir} || true; \
1372 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1373 # To build a target all-X means to cd to X and make all.
1374 .PHONY: $(ALL_TARGET_MODULES)
1375 $(ALL_TARGET_MODULES):
1376 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1377 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1378 r=`pwd`; export r; \
1379 s=`cd $(srcdir); pwd`; export s; \
1381 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1386 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1387 # To build a target install-X means to cd to X and make install.
1388 .PHONY: $(CHECK_TARGET_MODULES)
1389 $(CHECK_TARGET_MODULES):
1390 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1391 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1392 r=`pwd`; export r; \
1393 s=`cd $(srcdir); pwd`; export s; \
1395 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1400 # This rule is used to install the modules which use
1401 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1403 .PHONY: $(INSTALL_TARGET_MODULES)
1404 $(INSTALL_TARGET_MODULES): installdirs
1405 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1406 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1407 r=`pwd`; export r; \
1408 s=`cd $(srcdir); pwd`; export s; \
1410 (cd $(TARGET_SUBDIR)/$${dir}; \
1411 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1416 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1417 # To build a target all-X means to cd to X and make all.
1418 .PHONY: $(ALL_X11_MODULES)
1420 @dir=`echo $@ | sed -e 's/all-//'`; \
1421 if [ -f ./$${dir}/Makefile ] ; then \
1422 r=`pwd`; export r; \
1423 s=`cd $(srcdir); pwd`; export s; \
1426 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1431 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1432 # To build a target check-X means to cd to X and make all.
1433 .PHONY: $(CHECK_X11_MODULES)
1434 $(CHECK_X11_MODULES):
1435 @dir=`echo $@ | sed -e 's/check-//'`; \
1436 if [ -f ./$${dir}/Makefile ] ; then \
1437 r=`pwd`; export r; \
1438 s=`cd $(srcdir); pwd`; export s; \
1441 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1446 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1447 # To build a target install-X means to cd to X and make install.
1448 .PHONY: $(INSTALL_X11_MODULES)
1449 $(INSTALL_X11_MODULES): installdirs
1450 @dir=`echo $@ | sed -e 's/install-//'`; \
1451 if [ -f ./$${dir}/Makefile ] ; then \
1452 r=`pwd`; export r; \
1453 s=`cd $(srcdir); pwd`; export s; \
1456 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1461 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1464 @if [ -f ./gcc/Makefile ] ; then \
1465 r=`pwd`; export r; \
1466 s=`cd $(srcdir); pwd`; export s; \
1468 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1473 # Building GCC uses some tools for rebuilding "source" files
1474 # like texinfo, bison/byacc, etc. So we must depend on those.
1476 # While building GCC, it may be necessary to run various target
1477 # programs like the assembler, linker, etc. So we depend on
1480 # In theory, on an SMP all those dependencies can be resolved
1483 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1484 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1485 @r=`pwd`; export r; \
1486 s=`cd $(srcdir); pwd`; export s; \
1488 echo "Bootstrapping the compiler"; \
1489 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1490 @r=`pwd`; export r; \
1491 s=`cd $(srcdir); pwd`; export s; \
1493 *bootstrap4-lean ) \
1494 msg="Comparing stage3 and stage4 of the compiler"; \
1495 compare=compare3-lean ;; \
1496 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1497 compare=compare3 ;; \
1498 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1499 compare=compare-lean ;; \
1500 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1501 compare=compare ;; \
1505 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1506 @r=`pwd`; export r; \
1507 s=`cd $(srcdir); pwd` ; export s; \
1509 echo "Building runtime libraries"; \
1510 $(MAKE) $(BASE_FLAGS_TO_PASS) all
1513 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1514 @r=`pwd`; export r; \
1515 s=`cd $(srcdir); pwd`; export s; \
1517 echo "Building the C and C++ compiler"; \
1518 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1519 @r=`pwd`; export r; \
1520 s=`cd $(srcdir); pwd` ; export s; \
1522 echo "Building runtime libraries"; \
1523 $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
1527 @if [ -f ./gcc/Makefile ] ; then \
1528 r=`pwd`; export r; \
1529 s=`cd $(srcdir); pwd`; export s; \
1531 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1538 @if [ -f ./gcc/Makefile ] ; then \
1539 r=`pwd`; export r; \
1540 s=`cd $(srcdir); pwd`; export s; \
1542 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1547 .PHONY: install-gcc-cross
1549 @if [ -f ./gcc/Makefile ] ; then \
1550 r=`pwd`; export r; \
1551 s=`cd $(srcdir); pwd`; export s; \
1553 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1557 # EXPERIMENTAL STUFF
1558 # This rule is used to install the modules which use FLAGS_TO_PASS.
1559 # To build a target install-X means to cd to X and make install.
1560 .PHONY: install-dosrel
1561 install-dosrel: installdirs info
1562 @dir=`echo $@ | sed -e 's/install-//'`; \
1563 if [ -f ./$${dir}/Makefile ] ; then \
1564 r=`pwd`; export r; \
1565 s=`cd $(srcdir); pwd`; export s; \
1567 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1572 install-dosrel-fake:
1575 # This is a list of inter-dependencies among modules.
1578 all-autoconf: all-m4 all-texinfo
1579 all-automake: all-m4 all-texinfo
1581 all-bfd: all-libiberty all-intl
1582 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1583 all-bison: all-texinfo
1584 configure-target-boehm-gc: configure-target-newlib configure-target-qthreads
1585 all-target-boehm-gc: configure-target-boehm-gc
1586 configure-target-bsp: $(ALL_GCC)
1587 all-target-bsp: configure-target-bsp all-gcc all-binutils all-target-newlib
1591 configure-target-cygmon: $(ALL_GCC)
1592 all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub all-target-bsp
1594 all-dejagnu: all-tcl all-expect all-tk
1595 all-diff: all-libiberty
1597 all-emacs19: all-bison all-byacc
1599 configure-target-examples: $(ALL_GCC)
1600 all-target-examples: configure-target-examples
1601 all-expect: all-tcl all-tk
1602 all-fileutils: all-libiberty
1605 all-flex: all-libiberty all-bison all-byacc
1606 all-gas: all-libiberty all-opcodes all-bfd all-intl
1610 all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1611 all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld
1612 GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
1613 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1616 configure-target-gperf: $(ALL_GCC)
1617 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
1618 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1619 all-grep: all-libiberty
1620 all-grez: all-libiberty all-bfd all-opcodes
1621 all-gui: all-gdb all-libproc all-target-librx
1623 all-gzip: all-libiberty
1624 all-hello: all-libiberty
1626 all-inet: all-tcl all-send-pr all-perl
1628 all-ispell: all-emacs19
1629 all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1
1630 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1631 configure-target-libg++: $(ALL_GCC) configure-target-librx
1632 all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
1633 configure-target-libgloss: $(ALL_GCC)
1634 all-target-libgloss: configure-target-libgloss configure-target-newlib
1635 configure-target-libio: $(ALL_GCC)
1636 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1638 all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
1640 configure-target-libffi: $(ALL_GCC)
1641 configure-target-libjava: $(ALL_GCC) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-newlib configure-target-libffi
1642 all-target-libffi: configure-target-libffi
1643 all-target-libjava: configure-target-libjava all-gcc all-zip all-target-newlib all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1644 configure-target-librx: $(ALL_GCC) configure-target-newlib
1645 all-target-librx: configure-target-librx
1646 configure-target-libstdc++: $(ALL_GCC)
1647 configure-target-libstdc++-v3: $(ALL_GCC)
1648 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1649 all-target-libstdc++-v3: configure-target-libstdc++-v3 all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1650 configure-target-libstub: $(ALL_GCC)
1651 all-target-libstub: configure-target-libstub
1653 all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1654 all-target-libchill: configure-target-libchill all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1655 all-target-libobjc: configure-target-libobjc all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1656 all-m4: all-libiberty
1657 all-make: all-libiberty
1659 configure-target-newlib: $(ALL_GCC)
1660 configure-target-libtermcap: $(ALL_GCC)
1661 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1662 all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc
1663 all-opcodes: all-bfd all-libiberty
1664 all-patch: all-libiberty
1666 all-prms: all-libiberty
1667 configure-target-qthreads: configure-target-newlib
1668 all-target-qthreads: configure-target-qthreads
1671 all-recode: all-libiberty
1672 all-sed: all-libiberty
1673 all-send-pr: all-prms
1675 all-sim: all-libiberty all-bfd all-opcodes all-readline
1676 all-snavigator: all-tcl all-tk all-itcl all-db all-grep all-libgui
1677 all-tar: all-libiberty
1680 all-tclX: all-tcl all-tk
1682 all-tk8.1: all-tcl8.1
1683 all-texinfo: all-libiberty
1685 all-tgas: all-libiberty all-bfd all-opcodes
1687 all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1
1689 all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup
1690 configure-target-winsup: configure-target-newlib
1691 all-uudecode: all-libiberty
1693 configure-target-zlib: $(ALL_GCC)
1694 all-target-zlib: configure-target-zlib
1695 configure-target-libiberty: $(ALL_GCC) configure-target-newlib
1696 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1697 all-target: $(ALL_TARGET_MODULES)
1698 install-target: $(INSTALL_TARGET_MODULES)
1699 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1700 ### other supporting targets
1706 installdirs: mkinstalldirs
1707 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1709 dir.info: do-install-info
1710 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1711 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1712 mv -f dir.info.new dir.info ; \
1717 @echo "Building a full distribution of this tree isn't done"
1718 @echo "via 'make dist'. Check out the etc/ subdirectory"
1722 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1723 # ability to use several tags files at once, so there is probably no need
1724 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1725 # (if we felt like it) have this Makefile write a piece of elisp which
1726 # the user could load to tell emacs19 where all the TAGS files we just
1730 # with the gnu make, this is done automatically.
1732 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1733 $(SHELL) ./config.status
1736 # Support for building net releases
1738 # Files in devo used in any net release.
1739 # ChangeLog omitted because it may refer to files which are not in this
1740 # distribution (perhaps it would be better to include it anyway).
1741 DEVO_SUPPORT= README Makefile.in configure configure.in \
1742 config.guess config.if config.sub config move-if-change \
1743 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1744 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1745 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1747 # Files in devo/etc used in any net release.
1748 # ChangeLog omitted because it may refer to files which are not in this
1749 # distribution (perhaps it would be better to include it anyway).
1750 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1751 make-stds.texi standards.info*
1753 # When you use `make setup-dirs' or `make taz' you should always redefine
1755 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1757 # NOTE: No double quotes in the below. It is used within shell script
1759 VER = ` if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1760 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1762 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1767 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1768 $(MAKE) -f Makefile.in do-proto-toplev \
1769 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1770 MD5PROG="$(MD5PROG)" \
1771 SUPPORT_FILES="$(SUPPORT_FILES)"
1772 $(MAKE) -f Makefile.in do-md5sum \
1773 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1774 MD5PROG="$(MD5PROG)" \
1775 SUPPORT_FILES="$(SUPPORT_FILES)"
1776 $(MAKE) -f Makefile.in do-tar-bz2 \
1777 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1778 MD5PROG="$(MD5PROG)" \
1779 SUPPORT_FILES="$(SUPPORT_FILES)"
1782 gdb-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1783 $(MAKE) -f Makefile.in do-proto-toplev \
1784 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1785 MD5PROG="$(MD5PROG)" \
1786 SUPPORT_FILES="$(SUPPORT_FILES)"
1787 $(MAKE) -f Makefile.in do-md5sum \
1788 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1789 MD5PROG="$(MD5PROG)" \
1790 SUPPORT_FILES="$(SUPPORT_FILES)"
1791 $(MAKE) -f Makefile.in do-djunpack \
1792 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1793 MD5PROG="$(MD5PROG)" \
1794 SUPPORT_FILES="$(SUPPORT_FILES)"
1795 $(MAKE) -f Makefile.in do-tar-bz2 \
1796 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1797 MD5PROG="$(MD5PROG)" \
1798 SUPPORT_FILES="$(SUPPORT_FILES)"
1800 .PHONY: do-proto-toplev
1801 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1802 echo "==> Making $(PACKAGE)-$(VER)/"
1803 # Take out texinfo from a few places.
1804 sed -e '/^all\.normal: /s/\all-texinfo //' \
1805 -e '/^ install-texinfo /d' \
1807 mv -f tmp Makefile.in
1810 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1811 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1812 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1813 # Make links, and run "make diststuff" or "make info" when needed.
1814 rm -rf proto-toplev ; mkdir proto-toplev
1815 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1816 for d in $$dirs ; do \
1817 if [ -d $$d ]; then \
1818 if [ ! -f $$d/Makefile ] ; then true ; \
1819 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1820 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1821 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1822 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1824 if [ -d $$d/proto-$$d.dir ]; then \
1825 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1827 ln -s ../$$d proto-toplev/$$d ; \
1829 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1831 cd etc ; $(MAKE) info
1834 mkdir proto-toplev/etc
1835 (cd proto-toplev/etc; \
1836 for i in $(ETC_SUPPORT); do \
1837 ln -s ../../etc/$$i . ; \
1840 # Take out texinfo from configurable dirs
1841 rm proto-toplev/configure.in
1842 sed -e '/^host_tools=/s/texinfo //' \
1843 <configure.in >proto-toplev/configure.in
1845 mkdir proto-toplev/texinfo
1846 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1847 if test -r texinfo/util/tex3patch ; then \
1848 mkdir proto-toplev/texinfo/util && \
1849 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1851 chmod -R og=u . || chmod og=u `find . -print`
1853 -rm -f $(PACKAGE)-$(VER)
1854 ln -s proto-toplev $(PACKAGE)-$(VER)
1858 echo "==> Making $(PACKAGE)-$(VER).tar.bz2"
1859 -rm -f $(PACKAGE)-$(VER).tar.bz2
1860 find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
1861 | tar cTfh - $(PACKAGE)-$(VER).tar
1862 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1866 echo "==> Adding md5 checksum to top-level directory"
1867 cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
1868 | xargs $(MD5PROG) > ../md5.sum
1869 mv md5.sum proto-toplev
1873 echo "==> Adding updated djunpack.bat to top-level directory"
1874 echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1875 sed < djunpack.bat > djunpack.new \
1876 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1877 mv djunpack.new djunpack.bat
1878 -rm -f proto-toplev/djunpack.bat
1879 ln -s ../djunpack.bat proto-toplev/djunpack.bat
1881 TEXINFO_SUPPORT= texinfo/texinfo.tex
1882 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1885 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1886 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1887 $(MAKE) -f Makefile.in taz TOOL=gas \
1888 MD5PROG="$(MD5PROG)" \
1889 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1891 # The FSF "binutils" release includes gprof and ld.
1892 .PHONY: binutils.tar.bz2
1893 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1894 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1895 $(MAKE) -f Makefile.in taz TOOL=binutils \
1896 MD5PROG="$(MD5PROG)" \
1897 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1899 .PHONY: gas+binutils.tar.bz2
1900 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1901 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1902 $(MAKE) -f Makefile.in taz TOOL=gas \
1903 MD5PROG="$(MD5PROG)" \
1904 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1906 .PHONY: libg++.tar.bz2
1907 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1908 libg++.tar.bz2: $(DIST_SUPPORT) libg++
1909 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1910 MD5PROG="$(MD5PROG)" \
1911 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1913 GNATS_SUPPORT_DIRS=include libiberty send-pr
1914 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1915 $(MAKE) -f Makefile.in taz TOOL=gnats \
1916 MD5PROG="$(MD5PROG)" \
1917 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1920 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
1921 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1922 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
1923 MD5PROG="$(MD5PROG)" \
1924 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1926 .PHONY: dejagnu.tar.bz2
1927 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
1928 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
1929 $(MAKE) -f Makefile.in taz TOOL=dejagnu \
1930 MD5PROG="$(MD5PROG)" \
1931 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
1933 .PHONY: gdb+dejagnu.tar.bz2
1934 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
1935 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1936 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
1937 MD5PROG="$(MD5PROG)" \
1938 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1940 .PHONY: insight.tar.bz2
1941 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
1942 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1943 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
1944 MD5PROG="$(MD5PROG)" \
1945 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1947 .PHONY: insight+dejagnu.tar.bz2
1948 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
1949 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1950 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
1951 MD5PROG="$(MD5PROG)" \
1952 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1954 .PHONY: newlib.tar.bz2
1955 NEWLIB_SUPPORT_DIRS=libgloss
1956 # taz configures for the sun4 target which won't configure newlib.
1957 # We need newlib configured so that the .info files are made.
1958 # Unfortunately, it is not enough to just configure newlib separately:
1959 # taz will build the .info files but since SUBDIRS won't contain newlib,
1960 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1961 # used in building the .info files, eg: *.def, *.ref).
1962 # The problem isn't solvable however without a lot of extra work because
1963 # target libraries are built in subdir $(target_alias) which gets nuked during
1964 # the make distclean. For now punt on the issue of shipping newlib info files
1965 # with newlib net releases and wait for a day when some native target (sun4?)
1966 # supports newlib (if only minimally).
1967 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1968 $(MAKE) -f Makefile.in taz TOOL=newlib \
1969 MD5PROG="$(MD5PROG)" \
1970 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1971 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1976 # end of Makefile.in