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)
42 program_transform_name =
44 man1dir = $(mandir)/man1
45 man2dir = $(mandir)/man2
46 man3dir = $(mandir)/man3
47 man4dir = $(mandir)/man4
48 man5dir = $(mandir)/man5
49 man6dir = $(mandir)/man6
50 man7dir = $(mandir)/man7
51 man8dir = $(mandir)/man8
52 man9dir = $(mandir)/man9
53 infodir = $(prefix)/info
54 includedir = $(prefix)/include
55 # Directory in which the compiler finds executables, libraries, etc.
56 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
61 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
63 INSTALL_PROGRAM_ARGS =
65 INSTALL = $(SHELL) $$s/install-sh -c
66 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
67 INSTALL_SCRIPT = $(INSTALL)
68 INSTALL_DATA = $(INSTALL) -m 644
70 INSTALL_DOSREL = install-dosrel-fake
77 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
78 # here so that they can be overridden by Makefile fragments.
79 HOST_CC = $(CC_FOR_BUILD)
81 HOST_PREFIX_1 = loser-
83 # These flag values are normally overridden by the configure script.
89 CFLAGS_FOR_TARGET = $(CFLAGS)
91 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
95 CHILLFLAGS = $(CFLAGS)
99 # Use -O2 to stress test the compiler.
100 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -fexceptions
101 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
102 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates -fexceptions
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 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
144 then echo $$r/texinfo/makeinfo/makeinfo ; \
145 else echo makeinfo ; fi`
147 # This just becomes part of the MAKEINFO definition passed down to
148 # sub-makes. It lets flags be given on the command line while still
149 # using the makeinfo from the object tree.
152 EXPECT = `if [ -f $$r/expect/expect ] ; \
153 then echo $$r/expect/expect ; \
154 else echo expect ; fi`
156 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
157 then echo $$s/dejagnu/runtest ; \
158 else echo runtest ; fi`
161 # compilers to use to create programs which must be run in the build
164 CXX_FOR_BUILD = $(CXX)
166 SUBDIRS = "this is set via configure, don't edit this"
169 # This is set by the configure script to the list of directories which
170 # should be built using the target tools.
173 TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon
175 # Target libraries are put under this directory:
176 # Changed by configure to $(target_alias) if cross.
179 # This is set by the configure script to the arguments passed to configure.
182 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
186 # This is the name of the environment variable used for the path to
187 # the libraries. This may be changed by configure.in.
188 RPATH_ENVVAR = LD_LIBRARY_PATH
190 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
191 REALLY_SET_LIB_PATH = \
192 if [ x"$$$(RPATH_ENVVAR)" != x ]; then \
193 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
195 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes; \
197 export $(RPATH_ENVVAR);
200 INSTALL_TARGET = installdirs \
203 $(INSTALL_TARGET_MODULES) \
204 $(INSTALL_X11_MODULES) \
207 INSTALL_TARGET_CROSS = installdirs \
210 $(INSTALL_TARGET_MODULES) \
211 $(INSTALL_X11_MODULES) \
215 if [ -f $$r/gcc/xgcc ] ; then \
216 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
217 case "$(target_canonical)" in \
218 i[3456]86-*-cygwin*) \
219 echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -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; \
222 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
226 echo $$r/gcc/xgcc -B$$r/gcc/; \
229 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
232 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
236 # If CC_FOR_TARGET is not overriden on the command line, then this
237 # variable is passed down to the gcc Makefile, where it is used to
238 # build libgcc2.a. We define it here so that it can itself be
239 # overridden on the command line.
240 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
242 CHILL_FOR_TARGET = ` \
243 if [ -f $$r/gcc/xgcc ] ; then \
244 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
246 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
249 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
254 if [ -f $$r/gcc/xgcc ] ; then \
255 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
256 case "$(target_canonical)" in \
257 i[3456]86-*-cygwin*) \
258 echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -B$$r/$(TARGET_SUBDIR)/newlib/ -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; \
261 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
265 echo $$r/gcc/xgcc -B$$r/gcc/; \
268 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
271 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
276 if [ -f $$r/gas/as-new ] ; then \
277 echo $$r/gas/as-new ; \
279 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
282 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
287 if [ -f $$r/ld/ld-new ] ; then \
288 echo $$r/ld/ld-new ; \
290 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
293 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
297 DLLTOOL_FOR_TARGET = ` \
298 if [ -f $$r/binutils/dlltool ] ; then \
299 echo $$r/binutils/dlltool ; \
301 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
304 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
308 WINDRES_FOR_TARGET = ` \
309 if [ -f $$r/binutils/windres ] ; then \
310 echo $$r/binutils/windres ; \
312 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
315 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
320 if [ -f $$r/binutils/ar ] ; then \
321 echo $$r/binutils/ar ; \
323 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
326 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
330 RANLIB_FOR_TARGET = ` \
331 if [ -f $$r/binutils/ranlib ] ; then \
332 echo $$r/binutils/ranlib ; \
334 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
337 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
342 if [ -f $$r/binutils/nm-new ] ; then \
343 echo $$r/binutils/nm-new ; \
345 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
348 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
352 # The first rule in the file had better be this one. Don't put any above it.
353 # This lives here to allow makefile fragments to contain dependencies.
357 # These can be overridden by config/mt-*.
358 # The _TARGET_ is because they're specified in mt-foo.
359 # The _HOST_ is because they're programs that run on the host.
360 EXTRA_TARGET_HOST_ALL_MODULES =
361 EXTRA_TARGET_HOST_INSTALL_MODULES =
362 EXTRA_TARGET_HOST_CHECK_MODULES =
364 #### host and target specific makefile fragments come in here.
367 # Flags to pass down to all sub-makes.
368 # Please keep these in alphabetical order.
369 BASE_FLAGS_TO_PASS = \
370 "AR_FLAGS=$(AR_FLAGS)" \
371 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
372 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
374 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
375 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
377 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
378 "CHILLFLAGS=$(CHILLFLAGS)" \
379 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
380 "CHILL_LIB=$(CHILL_LIB)" \
381 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
382 "CXXFLAGS=$(CXXFLAGS)" \
383 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
384 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
385 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
386 "INSTALL=$(INSTALL)" \
387 "INSTALL_DATA=$(INSTALL_DATA)" \
388 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
389 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
390 "LDFLAGS=$(LDFLAGS)" \
392 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
393 "LIBCFLAGS=$(LIBCFLAGS)" \
394 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
395 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
396 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
399 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
400 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
401 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
402 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
405 "RUNTEST=$(RUNTEST)" \
406 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
407 "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
408 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
411 "datadir=$(datadir)" \
412 "exec_prefix=$(exec_prefix)" \
413 "includedir=$(includedir)" \
414 "infodir=$(infodir)" \
416 "libexecdir=$(libexecdir)" \
417 "lispdir=$(lispdir)" \
418 "localstatedir=$(localstatedir)" \
420 "oldincludedir=$(oldincludedir)" \
422 "sbindir=$(sbindir)" \
423 "sharedstatedir=$(sharedstatedir)" \
424 "sysconfdir=$(sysconfdir)" \
425 "tooldir=$(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).
578 $(EXTRA_TARGET_HOST_ALL_MODULES)
580 # This is a list of the check targets for all of the modules which are
581 # compiled using $(FLAGS_TO_PASS).
583 # The list is in two parts. The first lists those tools which
584 # are tested as part of the host's native tool-chain, and not
585 # tested in a cross configuration.
586 NATIVE_CHECK_MODULES = \
592 CROSS_CHECK_MODULES = \
648 $(EXTRA_TARGET_HOST_CHECK_MODULES)
650 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
652 # This is a list of the install targets for all of the modules which are
653 # compiled using $(FLAGS_TO_PASS).
654 # We put install-opcodes before install-binutils because the installed
655 # binutils might be on PATH, and they might need the shared opcodes
657 # We put install-tcl before install-itcl because itcl wants to run a
658 # program on installation which uses the Tcl libraries.
722 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
724 # This is a list of the targets for all of the modules which are compiled
725 # using $(X11_FLAGS_TO_PASS).
738 # This is a list of the check targets for all of the modules which are
739 # compiled using $(X11_FLAGS_TO_PASS).
740 CHECK_X11_MODULES = \
750 # This is a list of the install targets for all the modules which are
751 # compiled using $(X11_FLAGS_TO_PASS).
752 INSTALL_X11_MODULES = \
764 # This is a list of the targets for all of the modules which are compiled
765 # using $(TARGET_FLAGS_TO_PASS).
766 ALL_TARGET_MODULES = \
768 all-target-libstdc++ \
772 all-target-libtermcap \
774 all-target-libgloss \
775 all-target-libiberty \
777 all-target-examples \
782 # This is a list of the configure targets for all of the modules which
783 # are compiled using the target tools.
784 CONFIGURE_TARGET_MODULES = \
785 configure-target-libio \
786 configure-target-libstdc++ \
787 configure-target-librx \
788 configure-target-libg++ \
789 configure-target-newlib \
790 configure-target-libtermcap \
791 configure-target-winsup \
792 configure-target-libgloss \
793 configure-target-libiberty \
794 configure-target-gperf \
795 configure-target-examples \
796 configure-target-libstub \
797 configure-target-bsp \
798 configure-target-cygmon
800 # This is a list of the check targets for all of the modules which are
801 # compiled using $(TARGET_FLAGS_TO_PASS).
802 CHECK_TARGET_MODULES = \
804 check-target-libstdc++ \
805 check-target-libg++ \
806 check-target-newlib \
807 check-target-winsup \
808 check-target-libiberty \
811 # This is a list of the install targets for all of the modules which are
812 # compiled using $(TARGET_FLAGS_TO_PASS).
813 INSTALL_TARGET_MODULES = \
814 install-target-libio \
815 install-target-libstdc++ \
816 install-target-libg++ \
817 install-target-newlib \
818 install-target-libtermcap \
819 install-target-winsup \
820 install-target-libgloss \
821 install-target-libiberty \
825 # This is a list of the targets for which we can do a clean-{target}.
890 # All of the target modules that can be cleaned
891 CLEAN_TARGET_MODULES = \
893 clean-target-libstdc++ \
895 clean-target-libg++ \
896 clean-target-newlib \
897 clean-target-winsup \
898 clean-target-libgloss \
899 clean-target-libiberty \
901 clean-target-examples \
902 clean-target-libstub \
906 # All of the x11 modules that can be cleaned
907 CLEAN_X11_MODULES = \
918 # The target built for a native build.
923 $(ALL_TARGET_MODULES) \
926 # Do a target for all the subdirectories. A ``make do-X'' will do a
927 # ``make X'' in all subdirectories (because, in general, there is a
928 # dependency (below) of X upon do-X, a ``make X'' will also do this,
929 # but it may do additional work as well).
930 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
931 # because it is so large that it can easily overflow the command line
932 # length limit on some systems.
941 do-maintainer-clean \
945 @target=`echo $@ | sed -e 's/^do-//'`; \
947 s=`cd $(srcdir); pwd`; export s; \
949 for i in $(SUBDIRS) -dummy-; do \
950 if [ -f ./$$i/Makefile ]; then \
953 for flag in $(EXTRA_GCC_FLAGS); do \
954 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
958 for flag in $(EXTRA_HOST_FLAGS); do \
959 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
963 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
965 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
966 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
967 "RANLIB=$${RANLIB}" \
968 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
970 then true; else exit 1; fi; \
973 @target=`echo $@ | sed -e 's/^do-//'`; \
975 s=`cd $(srcdir); pwd`; export s; \
977 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
978 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
979 for flag in $(EXTRA_TARGET_FLAGS); do \
980 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
982 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
983 if (cd $(TARGET_SUBDIR)/$$i; \
984 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
985 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
986 "RANLIB=$${RANLIB}" \
987 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
989 then true; else exit 1; fi; \
993 # Here are the targets which correspond to the do-X targets.
995 .PHONY: info installcheck dvi install-info
996 .PHONY: clean distclean mostlyclean maintainer-clean realclean
997 .PHONY: local-clean local-distclean local-maintainer-clean
999 installcheck: do-installcheck
1002 # Make sure makeinfo is built before we do a `make info'.
1003 do-info: all-texinfo
1005 install-info: do-install-info dir.info
1006 s=`cd $(srcdir); pwd`; export s; \
1007 if [ -f dir.info ] ; then \
1008 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
1012 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
1015 -rm -f Makefile config.status config.cache mh-frag mt-frag
1016 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
1017 rm -rf $(TARGET_SUBDIR); \
1020 local-maintainer-clean:
1021 @echo "This command is intended for maintainers to use;"
1022 @echo "it deletes files that may require special tools to rebuild."
1024 clean: do-clean local-clean
1025 mostlyclean: do-mostlyclean local-clean
1026 distclean: do-distclean local-clean local-distclean
1027 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
1028 maintainer-clean: local-distclean
1029 realclean: maintainer-clean
1031 # This rule is used to clean specific modules.
1032 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
1033 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
1034 @dir=`echo $@ | sed -e 's/clean-//'`; \
1035 if [ -f ./$${dir}/Makefile ] ; then \
1036 r=`pwd`; export r; \
1037 s=`cd $(srcdir); pwd`; export s; \
1039 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
1044 .PHONY: $(CLEAN_TARGET_MODULES)
1045 $(CLEAN_TARGET_MODULES):
1046 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
1047 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1048 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1049 r=`pwd`; export r; \
1050 s=`cd $(srcdir); pwd`; export s; \
1052 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
1057 clean-target: $(CLEAN_TARGET_MODULES)
1062 check: $(CHECK_MODULES) \
1063 $(CHECK_TARGET_MODULES) \
1064 $(CHECK_X11_MODULES) \
1067 # Automated reporting of test results.
1069 warning.log: build.log
1070 $(srcdir)/contrib/warn_summary build.log > $@
1073 if test x'$(BOOT_CFLAGS)' != x''; then \
1074 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1076 $(srcdir)/contrib/test_summary -t >$@
1078 echo If you really want to send e-mail, run ./$@ now
1080 mail-report-with-warnings.log: warning.log
1081 if test x'$(BOOT_CFLAGS)' != x''; then \
1082 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1084 $(srcdir)/contrib/test_summary -t -i warning.log >$@
1086 echo If you really want to send e-mail, run ./$@ now
1088 # Installation targets.
1090 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
1091 install: $(INSTALL_TARGET)
1092 install-cross: $(INSTALL_TARGET_CROSS)
1095 @echo "the uninstall target is not supported in this tree"
1098 $(MAKE) -f ./release/Build-A-Release \
1099 host=$(host_alias) source-vault
1102 $(MAKE) -f ./release/Build-A-Release \
1103 host=$(host_alias) target=$(target_alias)
1106 @if [ -f ./release/vault-install ] ; then \
1107 ./release/vault-install $(host_alias) $(target_alias) ; \
1113 install.all: install-no-fixedincludes
1114 @if [ -f ./gcc/Makefile ] ; then \
1115 r=`pwd` ; export r ; \
1118 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1123 # inet-install is used because the I*Net wants DejaGNU installed but
1124 # not built. Similarly, gzip is built but not installed.
1126 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1128 # install-no-fixedincludes is used because Cygnus can not distribute
1129 # the fixed header files.
1130 .PHONY: install-no-fixedincludes
1131 install-no-fixedincludes: \
1133 $(INSTALL_MODULES) \
1134 $(INSTALL_TARGET_MODULES) \
1135 $(INSTALL_X11_MODULES) \
1136 gcc-no-fixedincludes
1138 # Install the gcc headers files, but not the fixed include files,
1139 # which Cygnus is not allowed to distribute. This rule is very
1140 # dependent on the workings of the gcc Makefile.in.
1141 .PHONY: gcc-no-fixedincludes
1142 gcc-no-fixedincludes:
1143 @if [ -f ./gcc/Makefile ]; then \
1144 rm -rf gcc/tmp-include; \
1145 mv gcc/include gcc/tmp-include 2>/dev/null; \
1146 mkdir gcc/include; \
1147 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1148 touch gcc/stmp-fixinc gcc/include/fixed; \
1149 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1150 r=`pwd`; export r; \
1151 s=`cd $(srcdir); pwd` ; export s; \
1154 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1155 rm -rf gcc/include; \
1156 mv gcc/tmp-include gcc/include 2>/dev/null; \
1160 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1161 # build a target all-X means to cd to X and make all.
1163 # all-gui, and all-libproc are handled specially because
1164 # they are still experimental, and if they fail to build, that
1165 # shouldn't stop "make all".
1166 .PHONY: $(ALL_MODULES) all-gui all-libproc
1167 $(ALL_MODULES) all-gui all-libproc:
1168 @dir=`echo $@ | sed -e 's/all-//'`; \
1169 if [ -f ./$${dir}/Makefile ] ; then \
1170 r=`pwd`; export r; \
1171 s=`cd $(srcdir); pwd`; export s; \
1173 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1178 # These rules are used to check the modules which use FLAGS_TO_PASS.
1179 # To build a target check-X means to cd to X and make check. Some
1180 # modules are only tested in a native toolchain.
1182 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1183 $(NATIVE_CHECK_MODULES):
1184 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1185 dir=`echo $@ | sed -e 's/check-//'`; \
1186 if [ -f ./$${dir}/Makefile ] ; then \
1187 r=`pwd`; export r; \
1188 s=`cd $(srcdir); pwd`; export s; \
1190 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1196 $(CROSS_CHECK_MODULES):
1197 @dir=`echo $@ | sed -e 's/check-//'`; \
1198 if [ -f ./$${dir}/Makefile ] ; then \
1199 r=`pwd`; export r; \
1200 s=`cd $(srcdir); pwd`; export s; \
1202 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1207 # This rule is used to install the modules which use FLAGS_TO_PASS.
1208 # To build a target install-X means to cd to X and make install.
1209 .PHONY: $(INSTALL_MODULES)
1210 $(INSTALL_MODULES): installdirs
1211 @dir=`echo $@ | sed -e 's/install-//'`; \
1212 if [ -f ./$${dir}/Makefile ] ; then \
1213 r=`pwd`; export r; \
1214 s=`cd $(srcdir); pwd`; export s; \
1216 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1221 # This rule is used to configure the modules which are built with the
1223 .PHONY: $(CONFIGURE_TARGET_MODULES)
1224 $(CONFIGURE_TARGET_MODULES):
1225 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1226 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1227 r=`pwd`; export r; \
1228 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1229 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1230 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1231 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1232 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1234 echo "Multilibs changed for $${dir}, reconfiguring"; \
1235 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1236 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1239 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1242 fi; exit 0 # break command into two pieces
1243 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1244 if [ ! -d $(TARGET_SUBDIR) ]; then \
1246 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1248 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1249 if [ -d $(srcdir)/$${dir} ]; then \
1250 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1251 r=`pwd`; export r; \
1252 s=`cd $(srcdir); pwd`; export s; \
1254 AR="$(AR_FOR_TARGET)"; export AR; \
1255 AS="$(AS_FOR_TARGET)"; export AS; \
1256 CC="$(CC_FOR_TARGET)"; export CC; \
1257 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1258 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1259 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1260 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1261 LD="$(LD_FOR_TARGET)"; export LD; \
1262 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1263 NM="$(NM_FOR_TARGET)"; export NM; \
1264 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1265 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1266 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1267 cd $(TARGET_SUBDIR)/$${dir}; \
1270 topdir=$(srcdir) ;; \
1272 case "$(TARGET_SUBDIR)" in \
1273 .) topdir="../$(srcdir)" ;; \
1274 *) topdir="../../$(srcdir)" ;; \
1277 if [ "$(srcdir)" = "." ] ; then \
1278 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1279 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1280 if [ -f Makefile ]; then \
1281 if $(MAKE) distclean; then \
1295 srcdiroption="--srcdir=."; \
1298 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1299 libsrcdir="$$s/$${dir}"; \
1301 if [ -f $${libsrcdir}/configure ] ; then \
1302 rm -f no-such-file skip-this-dir; \
1303 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1304 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1305 --with-target-subdir="$(TARGET_SUBDIR)"; \
1307 rm -f no-such-file skip-this-dir; \
1308 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1309 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1310 --with-target-subdir="$(TARGET_SUBDIR)"; \
1312 if [ -f skip-this-dir ] ; then \
1314 rm -f skip-this-dir; \
1315 cd ..; rmdir $${dir} || true; \
1326 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1327 # To build a target all-X means to cd to X and make all.
1328 .PHONY: $(ALL_TARGET_MODULES)
1329 $(ALL_TARGET_MODULES):
1330 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1331 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1332 r=`pwd`; export r; \
1333 s=`cd $(srcdir); pwd`; export s; \
1335 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1340 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1341 # To build a target install-X means to cd to X and make install.
1342 .PHONY: $(CHECK_TARGET_MODULES)
1343 $(CHECK_TARGET_MODULES):
1344 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1345 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1346 r=`pwd`; export r; \
1347 s=`cd $(srcdir); pwd`; export s; \
1349 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1354 # This rule is used to install the modules which use
1355 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1357 .PHONY: $(INSTALL_TARGET_MODULES)
1358 $(INSTALL_TARGET_MODULES): installdirs
1359 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1360 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1361 r=`pwd`; export r; \
1362 s=`cd $(srcdir); pwd`; export s; \
1364 (cd $(TARGET_SUBDIR)/$${dir}; \
1365 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1370 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1371 # To build a target all-X means to cd to X and make all.
1372 .PHONY: $(ALL_X11_MODULES)
1374 @dir=`echo $@ | sed -e 's/all-//'`; \
1375 if [ -f ./$${dir}/Makefile ] ; then \
1376 r=`pwd`; export r; \
1377 s=`cd $(srcdir); pwd`; export s; \
1380 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1385 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1386 # To build a target check-X means to cd to X and make all.
1387 .PHONY: $(CHECK_X11_MODULES)
1388 $(CHECK_X11_MODULES):
1389 @dir=`echo $@ | sed -e 's/check-//'`; \
1390 if [ -f ./$${dir}/Makefile ] ; then \
1391 r=`pwd`; export r; \
1392 s=`cd $(srcdir); pwd`; export s; \
1395 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1400 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1401 # To build a target install-X means to cd to X and make install.
1402 .PHONY: $(INSTALL_X11_MODULES)
1403 $(INSTALL_X11_MODULES): installdirs
1404 @dir=`echo $@ | sed -e 's/install-//'`; \
1405 if [ -f ./$${dir}/Makefile ] ; then \
1406 r=`pwd`; export r; \
1407 s=`cd $(srcdir); pwd`; export s; \
1410 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1415 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1418 @if [ -f ./gcc/Makefile ] ; then \
1419 r=`pwd`; export r; \
1420 s=`cd $(srcdir); pwd`; export s; \
1422 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1427 # Building GCC uses some tools for rebuilding "source" files
1428 # like texinfo, bison/byacc, etc. So we must depend on those.
1430 # While building GCC, it may be necessary to run various target
1431 # programs like the assembler, linker, etc. So we depend on
1434 # In theory, on an SMP all those dependencies can be resolved
1437 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1438 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1439 @r=`pwd`; export r; \
1440 s=`cd $(srcdir); pwd`; export s; \
1442 echo "Bootstrapping the compiler"; \
1443 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1444 @r=`pwd`; export r; \
1445 s=`cd $(srcdir); pwd`; export s; \
1447 *bootstrap4-lean ) \
1448 msg="Comparing stage3 and stage4 of the compiler"; \
1449 compare=compare3-lean ;; \
1450 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1451 compare=compare3 ;; \
1452 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1453 compare=compare-lean ;; \
1454 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1455 compare=compare ;; \
1459 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1460 @r=`pwd`; export r; \
1461 s=`cd $(srcdir); pwd` ; export s; \
1463 echo "Building runtime libraries"; \
1464 $(MAKE) $(BASE_FLAGS_TO_PASS) all
1467 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1468 @r=`pwd`; export r; \
1469 s=`cd $(srcdir); pwd`; export s; \
1471 echo "Building the C and C++ compiler"; \
1472 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1473 @r=`pwd`; export r; \
1474 s=`cd $(srcdir); pwd` ; export s; \
1476 echo "Building runtime libraries"; \
1477 $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
1481 @if [ -f ./gcc/Makefile ] ; then \
1482 r=`pwd`; export r; \
1483 s=`cd $(srcdir); pwd`; export s; \
1485 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1492 @if [ -f ./gcc/Makefile ] ; then \
1493 r=`pwd`; export r; \
1494 s=`cd $(srcdir); pwd`; export s; \
1496 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1501 .PHONY: install-gcc-cross
1503 @if [ -f ./gcc/Makefile ] ; then \
1504 r=`pwd`; export r; \
1505 s=`cd $(srcdir); pwd`; export s; \
1507 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1511 # EXPERIMENTAL STUFF
1512 # This rule is used to install the modules which use FLAGS_TO_PASS.
1513 # To build a target install-X means to cd to X and make install.
1514 .PHONY: install-dosrel
1515 install-dosrel: installdirs info
1516 @dir=`echo $@ | sed -e 's/install-//'`; \
1517 if [ -f ./$${dir}/Makefile ] ; then \
1518 r=`pwd`; export r; \
1519 s=`cd $(srcdir); pwd`; export s; \
1521 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1526 install-dosrel-fake:
1529 # This is a list of inter-dependencies among modules.
1532 all-autoconf: all-m4 all-texinfo
1533 all-automake: all-m4 all-texinfo
1535 all-bfd: all-libiberty all-intl
1536 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1537 all-bison: all-texinfo
1538 configure-target-bsp: $(ALL_GCC)
1539 all-target-bsp: configure-target-bsp all-gcc all-binutils all-target-newlib
1543 configure-target-cygmon: $(ALL_GCC)
1544 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
1546 all-dejagnu: all-tcl all-expect all-tk
1547 all-diff: all-libiberty
1549 all-emacs19: all-bison all-byacc
1551 configure-target-examples: $(ALL_GCC)
1552 all-target-examples: configure-target-examples
1553 all-expect: all-tcl all-tk
1554 all-fileutils: all-libiberty
1557 all-flex: all-libiberty all-bison all-byacc
1558 all-gas: all-libiberty all-opcodes all-bfd all-intl
1562 all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1563 all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld
1564 GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
1565 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1568 configure-target-gperf: $(ALL_GCC)
1569 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
1570 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1571 all-grez: all-libiberty all-bfd all-opcodes
1572 all-gui: all-gdb all-libproc all-target-librx
1574 all-gzip: all-libiberty
1575 all-hello: all-libiberty
1577 all-inet: all-tcl all-send-pr all-perl
1579 all-ispell: all-emacs19
1580 all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1
1581 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1582 configure-target-libg++: $(ALL_GCC) configure-target-librx
1583 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++
1584 configure-target-libgloss: $(ALL_GCC)
1585 all-target-libgloss: configure-target-libgloss configure-target-newlib
1586 configure-target-libio: $(ALL_GCC)
1587 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1589 all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
1591 configure-target-librx: $(ALL_GCC) configure-target-newlib
1592 all-target-librx: configure-target-librx
1593 configure-target-libstdc++: $(ALL_GCC)
1594 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1595 configure-target-libstub: $(ALL_GCC)
1596 all-target-libstub: configure-target-libstub
1598 all-m4: all-libiberty
1599 all-make: all-libiberty
1601 configure-target-newlib: $(ALL_GCC)
1602 configure-target-libtermcap: $(ALL_GCC)
1603 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1604 all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc
1605 all-opcodes: all-bfd all-libiberty
1606 all-patch: all-libiberty
1608 all-prms: all-libiberty
1611 all-recode: all-libiberty
1612 all-sed: all-libiberty
1613 all-send-pr: all-prms
1615 all-sim: all-libiberty all-bfd all-opcodes all-readline
1616 all-tar: all-libiberty
1619 all-tclX: all-tcl all-tk
1621 all-tk8.1: all-tcl8.1
1622 all-texinfo: all-libiberty
1624 all-tgas: all-libiberty all-bfd all-opcodes
1626 all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1
1628 all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup
1629 configure-target-winsup: configure-target-newlib
1630 all-uudecode: all-libiberty
1632 configure-target-libiberty: $(ALL_GCC)
1633 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1634 all-target: $(ALL_TARGET_MODULES)
1635 install-target: $(INSTALL_TARGET_MODULES)
1636 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1637 ### other supporting targets
1643 installdirs: mkinstalldirs
1644 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1646 dir.info: do-install-info
1647 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1648 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1649 mv -f dir.info.new dir.info ; \
1654 @echo "Building a full distribution of this tree isn't done"
1655 @echo "via 'make dist'. Check out the etc/ subdirectory"
1659 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1660 # ability to use several tags files at once, so there is probably no need
1661 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1662 # (if we felt like it) have this Makefile write a piece of elisp which
1663 # the user could load to tell emacs19 where all the TAGS files we just
1667 # with the gnu make, this is done automatically.
1669 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1670 $(SHELL) ./config.status
1673 # Support for building net releases
1675 # Files in devo used in any net release.
1676 # ChangeLog omitted because it may refer to files which are not in this
1677 # distribution (perhaps it would be better to include it anyway).
1678 DEVO_SUPPORT= README Makefile.in configure configure.in \
1679 config.guess config.if config.sub config move-if-change \
1680 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1681 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1682 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1684 # Files in devo/etc used in any net release.
1685 # ChangeLog omitted because it may refer to files which are not in this
1686 # distribution (perhaps it would be better to include it anyway).
1687 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1688 make-stds.texi standards.info*
1690 # When you use `make setup-dirs' or `make taz' you should always redefine
1692 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1694 # NOTE: No double quotes in the below. It is used within shell script
1696 VER = ` if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1697 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1699 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1704 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1705 $(MAKE) -f Makefile.in do-proto-toplev \
1706 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1707 MD5PROG="$(MD5PROG)" \
1708 SUPPORT_FILES="$(SUPPORT_FILES)"
1709 $(MAKE) -f Makefile.in do-md5sum \
1710 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1711 MD5PROG="$(MD5PROG)" \
1712 SUPPORT_FILES="$(SUPPORT_FILES)"
1713 $(MAKE) -f Makefile.in do-tar-bz2 \
1714 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1715 MD5PROG="$(MD5PROG)" \
1716 SUPPORT_FILES="$(SUPPORT_FILES)"
1719 gdb-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1720 $(MAKE) -f Makefile.in do-proto-toplev \
1721 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1722 MD5PROG="$(MD5PROG)" \
1723 SUPPORT_FILES="$(SUPPORT_FILES)"
1724 $(MAKE) -f Makefile.in do-md5sum \
1725 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1726 MD5PROG="$(MD5PROG)" \
1727 SUPPORT_FILES="$(SUPPORT_FILES)"
1728 $(MAKE) -f Makefile.in do-djunpack \
1729 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1730 MD5PROG="$(MD5PROG)" \
1731 SUPPORT_FILES="$(SUPPORT_FILES)"
1732 $(MAKE) -f Makefile.in do-tar-bz2 \
1733 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1734 MD5PROG="$(MD5PROG)" \
1735 SUPPORT_FILES="$(SUPPORT_FILES)"
1737 .PHONY: do-proto-toplev
1738 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1739 echo "==> Making $(PACKAGE)-$(VER)/"
1740 # Take out texinfo from a few places.
1741 sed -e '/^all\.normal: /s/\all-texinfo //' \
1742 -e '/^ install-texinfo /d' \
1744 mv -f tmp Makefile.in
1747 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1748 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1749 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1750 # Make links, and run "make diststuff" or "make info" when needed.
1751 rm -rf proto-toplev ; mkdir proto-toplev
1752 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1753 for d in $$dirs ; do \
1754 if [ -d $$d ]; then \
1755 if [ ! -f $$d/Makefile ] ; then true ; \
1756 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1757 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1758 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1759 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1761 if [ -d $$d/proto-$$d.dir ]; then \
1762 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1764 ln -s ../$$d proto-toplev/$$d ; \
1766 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1768 cd etc ; $(MAKE) info
1771 mkdir proto-toplev/etc
1772 (cd proto-toplev/etc; \
1773 for i in $(ETC_SUPPORT); do \
1774 ln -s ../../etc/$$i . ; \
1777 # Take out texinfo from configurable dirs
1778 rm proto-toplev/configure.in
1779 sed -e '/^host_tools=/s/texinfo //' \
1780 <configure.in >proto-toplev/configure.in
1782 mkdir proto-toplev/texinfo
1783 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1784 if test -r texinfo/util/tex3patch ; then \
1785 mkdir proto-toplev/texinfo/util && \
1786 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1788 chmod -R og=u . || chmod og=u `find . -print`
1790 -rm -f $(PACKAGE)-$(VER)
1791 ln -s proto-toplev $(PACKAGE)-$(VER)
1795 echo "==> Making $(PACKAGE)-$(VER).tar.bz2"
1796 tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER)
1797 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1801 echo "==> Adding md5 checksum to top-level directory"
1802 ( cd proto-toplev && find * -follow -type f -print | xargs $(MD5PROG) ) > md5.sum
1803 mv md5.sum proto-toplev
1807 echo "==> Adding updated djunpack.bat to top-level directory"
1808 echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1809 sed < djunpack.bat > djunpack.new \
1810 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1811 mv djunpack.new djunpack.bat
1812 -rm -f proto-toplev/djunpack.bat
1813 ln -s ../djunpack.bat proto-toplev/djunpack.bat
1815 TEXINFO_SUPPORT= texinfo/texinfo.tex
1816 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1819 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1820 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1821 $(MAKE) -f Makefile.in taz TOOL=gas \
1822 MD5PROG="$(MD5PROG)" \
1823 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1825 # The FSF "binutils" release includes gprof and ld.
1826 .PHONY: binutils.tar.bz2
1827 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1828 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1829 $(MAKE) -f Makefile.in taz TOOL=binutils \
1830 MD5PROG="$(MD5PROG)" \
1831 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1833 .PHONY: gas+binutils.tar.bz2
1834 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1835 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1836 $(MAKE) -f Makefile.in taz TOOL=gas \
1837 MD5PROG="$(MD5PROG)" \
1838 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1840 .PHONY: libg++.tar.bz2
1841 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1842 libg++.tar.bz2: $(DIST_SUPPORT) libg++
1843 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1844 MD5PROG="$(MD5PROG)" \
1845 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1847 GNATS_SUPPORT_DIRS=include libiberty send-pr
1848 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1849 $(MAKE) -f Makefile.in taz TOOL=gnats \
1850 MD5PROG="$(MD5PROG)" \
1851 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1854 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
1855 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1856 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
1857 MD5PROG="$(MD5PROG)" \
1858 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1860 .PHONY: dejagnu.tar.bz2
1861 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
1862 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
1863 $(MAKE) -f Makefile.in taz TOOL=dejagnu \
1864 MD5PROG="$(MD5PROG)" \
1865 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
1867 .PHONY: gdb+dejagnu.tar.bz2
1868 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
1869 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1870 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
1871 MD5PROG="$(MD5PROG)" \
1872 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1874 .PHONY: insight.tar.bz2
1875 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
1876 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1877 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
1878 MD5PROG="$(MD5PROG)" \
1879 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1881 .PHONY: insight+dejagnu.tar.bz2
1882 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
1883 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1884 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
1885 MD5PROG="$(MD5PROG)" \
1886 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1888 .PHONY: newlib.tar.bz2
1889 NEWLIB_SUPPORT_DIRS=libgloss
1890 # taz configures for the sun4 target which won't configure newlib.
1891 # We need newlib configured so that the .info files are made.
1892 # Unfortunately, it is not enough to just configure newlib separately:
1893 # taz will build the .info files but since SUBDIRS won't contain newlib,
1894 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1895 # used in building the .info files, eg: *.def, *.ref).
1896 # The problem isn't solvable however without a lot of extra work because
1897 # target libraries are built in subdir $(target_alias) which gets nuked during
1898 # the make distclean. For now punt on the issue of shipping newlib info files
1899 # with newlib net releases and wait for a day when some native target (sun4?)
1900 # supports newlib (if only minimally).
1901 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1902 $(MAKE) -f Makefile.in taz TOOL=newlib \
1903 MD5PROG="$(MD5PROG)" \
1904 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1905 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1910 # end of Makefile.in