2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(exec_prefix)/$(target)
29 program_transform_name =
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
48 INSTALL = $${srcroot}/install.sh -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL) -m 644
51 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
53 INSTALL_DOSREL = install-dosrel-fake
60 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
61 # here so that they can be overridden by Makefile fragments.
62 HOST_CC = $(CC_FOR_BUILD)
64 HOST_PREFIX_1 = loser-
66 # We don't specify -g -O because many compilers don't support -g -O,
67 # and/or -O is broken in and of itself.
70 CFLAGS_FOR_TARGET = $(CFLAGS)
71 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
73 # start-sanitize-chill
74 CHILLFLAGS = $(CFLAGS)
79 # Use -O2 to stress test the compiler.
81 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
82 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
83 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET)
87 # Not plain GZIP, since gzip looks there for extra command-line options.
90 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
91 BISON = `if [ -f $$r/byacc/byacc ] ; \
92 then echo $$r/byacc/byacc ; \
96 LEX = `if [ -f $$r/flex/flex ] ; \
97 then echo $$r/flex/flex ; \
100 M4 = `if [ -f $$r/m4/m4 ] ; \
101 then echo $$r/m4/m4 ; \
104 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
105 then echo $$r/texinfo/makeinfo/makeinfo ; \
106 else echo makeinfo ; fi`
108 # This just becomes part of the MAKEINFO definition passed down to
109 # sub-makes. It lets flags be given on the command line while still
110 # using the makeinfo from the object tree.
113 EXPECT = `if [ -f $$r/expect/expect ] ; \
114 then echo $$r/expect/expect ; \
115 else echo expect ; fi`
117 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
118 then echo $${srcroot}/dejagnu/runtest ; \
119 else echo runtest ; fi`
122 # libraries that may need to be augmented on a system-by-system basis
125 # compilers to use to create programs which must be run in the build
128 CXX_FOR_BUILD = $(CXX)
130 SUBDIRS = "this is set via configure, don't edit this"
134 INSTALL_TARGET = install-dirs \
136 $(INSTALL_TARGET_MODULES) \
137 $(INSTALL_X11_MODULES) \
143 if [ -f $$r/gcc/Makefile ] ; then \
144 if [ -f $$r/newlib/Makefile ] ; then \
145 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
147 echo $$r/gcc/xgcc -B$$r/gcc/; \
150 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
153 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
157 # start-sanitize-chill
158 CHILL_FOR_TARGET = ` \
159 if [ -f $$r/gcc/Makefile ] ; then \
160 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
162 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
165 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
172 if [ -f $$r/gcc/Makefile ] ; then \
173 if [ -f $$r/newlib/Makefile ] ; then \
174 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
176 echo $$r/gcc/xgcc -B$$r/gcc/; \
179 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
182 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
187 if [ -f $$r/gas/Makefile ] ; then \
188 echo $$r/gas/as.new ; \
190 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
193 t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
198 if [ -f $$r/binutils/ar ] ; then \
199 echo $$r/binutils/ar ; \
201 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
204 t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
208 RANLIB_FOR_TARGET = ` \
209 if [ -f $$r/binutils/ranlib ] ; then \
210 echo $$r/binutils/ranlib ; \
212 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
215 t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
220 if [ -f $$r/binutils/Makefile ] ; then \
221 echo $$r/binutils/nm.new ; \
223 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
226 t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
231 #### host and target specific makefile fragments come in here.
234 # Flags to pass down to all sub-makes.
235 # Please keep these in alphabetical order.
236 BASE_FLAGS_TO_PASS = \
237 "AR_FLAGS=$(AR_FLAGS)" \
238 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
239 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
241 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
242 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
244 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
245 $(start-sanitize-chill)\
246 "CHILLFLAGS=$(CHILLFLAGS)" \
247 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
248 "CHILL_LIB=$(CHILL_LIB)" \
249 $(end-sanitize-chill)\
250 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
251 "CXXFLAGS=$(CXXFLAGS)" \
252 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
253 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
254 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
255 "INSTALL=$(INSTALL)" \
256 "INSTALL_DATA=$(INSTALL_DATA)" \
257 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
258 "INSTALL_XFORM=$(INSTALL_XFORM)" \
259 "LDFLAGS=$(LDFLAGS)" \
261 "LIBCFLAGS=$(LIBCFLAGS)" \
262 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
263 "LIBCXXFLAGS=$(LIBCFLAGS)" \
264 "LIBCXXFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
266 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
267 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
268 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
271 "RUNTEST=$(RUNTEST)" \
272 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
274 "exec_prefix=$(exec_prefix)" \
278 # Flags to pass down to most sub-makes, in which we're building with
279 # the host environment.
280 # If any variables are added here, they must be added to do-*, below.
289 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
291 # Flags that are concerned with the location of the X11 include files
293 X11_FLAGS_TO_PASS = \
294 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
295 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
298 # Flags to pass down to makes which are built with the target environment.
299 # The double $ decreases the length of the command line; the variables
300 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
301 # If any variables are added here, they must be added to do-*, below.
302 EXTRA_TARGET_FLAGS = \
303 'AR=$$(AR_FOR_TARGET)' \
304 'AS=$$(AS_FOR_TARGET)' \
305 'CC=$$(CC_FOR_TARGET)' \
306 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
307 'CXX=$$(CXX_FOR_TARGET)' \
308 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
309 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
310 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
311 'NM=$$(NM_FOR_TARGET)' \
312 'RANLIB=$$(RANLIB_FOR_TARGET)'
314 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
316 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
317 # unfortunately needs the native compiler and the target ar and
319 # If any variables are added here, they must be added to do-*, below.
320 # The HOST_* variables are a special case, which are used for the gcc
321 # cross-building scheme.
323 'AR=$$(AR_FOR_TARGET)' \
327 'HOST_CC=$(CC_FOR_BUILD)' \
328 'HOST_PREFIX=$(HOST_PREFIX)' \
329 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
331 'RANLIB=$$(RANLIB_FOR_TARGET)'
333 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
335 # This is a list of the targets for all of the modules which are compiled
336 # using $(FLAGS_TO_PASS).
385 # This is a list of the check targets for all of the modules which are
386 # compiled using $(FLAGS_TO_PASS).
387 # This is a list of the check targets for all of the modules which are
388 # compiled using $(FLAGS_TO_PASS).
390 # The list is in two parts. The first lists those tools which
391 # are tested as part of the host's native tool-chain, and not
392 # tested in a cross configuration.
393 NATIVE_CHECK_MODULES = \
397 CROSS_CHECK_MODULES = \
441 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
443 # This is a list of the install targets for all of the modules which are
444 # compiled using $(FLAGS_TO_PASS).
493 # This is a list of the targets for all of the modules which are compiled
494 # using $(X11_FLAGS_TO_PASS).
503 # This is a list of the check targets for all of the modules which are
504 # compiled using $(X11_FLAGS_TO_PASS).
505 CHECK_X11_MODULES = \
512 # This is a list of the install targets for all the modules which are
513 # compiled using $(X11_FLAGS_TO_PASS).
514 INSTALL_X11_MODULES = \
522 # This is a list of the targets for all of the modules which are compiled
523 # using $(TARGET_FLAGS_TO_PASS).
524 ALL_TARGET_MODULES = \
525 $(start-sanitize-chill) \
527 $(end-sanitize-chill) \
536 # This is a list of the check targets for all of the modules which are
537 # compiled using $(TARGET_FLAGS_TO_PASS).
538 CHECK_TARGET_MODULES = \
539 $(start-sanitize-chill) \
541 $(end-sanitize-chill) \
548 # This is a list of the install targets for all of the modules which are
549 # compiled using $(TARGET_FLAGS_TO_PASS).
550 INSTALL_TARGET_MODULES = \
551 $(start-sanitize-chill) \
553 $(end-sanitize-chill) \
561 # This is a shell case of all modules which are compiled using
562 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
563 TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty
564 # start-sanitize-chill
565 TARGET_LIBS = chillrt | libio | libstdc++ | librx | libg++ | newlib | xiberty
568 # The first rule in the file had better be this one. Don't put any above it.
572 # The target built for a native build.
576 $(ALL_TARGET_MODULES) \
580 # Do a target for all the subdirectories. A ``make do-X'' will do a
581 # ``make X'' in all subdirectories (because, in general, there is a
582 # dependency (below) of X upon do-X, a ``make X'' will also do this,
583 # but it may do additional work as well).
584 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
585 # because it is so large that it can easily overflow the command line
586 # length limit on some systems.
599 @target=`echo $@ | sed -e 's/^do-//'`; \
601 srcroot=`cd $(srcdir); pwd`; export srcroot; \
602 for i in $(SUBDIRS); do \
603 if [ -f ./$$i/Makefile ]; then \
606 for flag in $(EXTRA_TARGET_FLAGS); do \
607 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
611 for flag in $(EXTRA_GCC_FLAGS); do \
612 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
616 for flag in $(EXTRA_HOST_FLAGS); do \
617 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
621 export AR AS CC CXX NM RANLIB; \
623 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
624 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
625 "RANLIB=$${RANLIB}" \
627 then true; else exit 1; fi; \
631 # Here are the targets which correspond to the do-X targets.
633 .PHONY: info installcheck dvi install-info
634 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
636 installcheck: do-installcheck
639 install-info: do-install-info dir.info
640 srcroot=`cd $(srcdir); pwd`; export srcroot; \
641 if [ -f dir.info ] ; then \
642 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
646 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
649 -rm -f Makefile config.status
651 clean: do-clean local-clean
652 mostlyclean: do-mostlyclean local-clean
653 distclean: do-distclean local-clean local-distclean
654 realclean: do-realclean local-clean local-distclean
659 check: $(CHECK_MODULES) \
660 $(CHECK_TARGET_MODULES) \
661 $(CHECK_X11_MODULES) \
664 # Installation targets.
666 .PHONY: install uninstall vault-install
667 install: $(INSTALL_TARGET)
670 @echo "the uninstall target is not supported in this tree"
673 @if [ -f ./release/vault-install ] ; then \
674 ./release/vault-install $(host_alias) $(target_alias) ; \
680 install.all: install-no-fixedincludes
681 @if [ -f ./gcc/Makefile ] ; then \
682 r=`pwd` ; export r ; \
684 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
689 # install-no-fixedincludes is used because Cygnus can not distribute
690 # the fixed header files.
691 .PHONY: install-no-fixedincludes
692 install-no-fixedincludes: \
695 $(INSTALL_TARGET_MODULES) \
696 $(INSTALL_X11_MODULES) \
699 # Install the gcc headers files, but not the fixed include files,
700 # which Cygnus is not allowed to distribute. This rule is very
701 # dependent on the workings of the gcc Makefile.in.
702 .PHONY: gcc-no-fixedincludes
703 gcc-no-fixedincludes:
704 @if [ -f ./gcc/Makefile ]; then \
705 rm -rf gcc/tmp-include; \
706 mv gcc/include gcc/tmp-include 2>/dev/null; \
708 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
709 touch gcc/stmp-fixinc gcc/include/fixed; \
710 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
712 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
714 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
715 rm -rf gcc/include; \
716 mv gcc/tmp-include gcc/include 2>/dev/null; \
719 # This rule is used to build the modules which use FLAGS_TO_PASS. To
720 # build a target all-X means to cd to X and make all.
721 # all-glob is handled specially because it doesn't actually build.
723 # all-gui, and all-libproc are handled specially because
724 # they are still experimental, and if they fail to build, that
725 # shouldn't stop "make all".
726 .PHONY: $(ALL_MODULES) all-glob all-gui all-libproc
727 $(ALL_MODULES) all-glob all-gui all-libproc:
728 @dir=`echo $@ | sed -e 's/all-//'`; \
729 if [ -f ./$${dir}/Makefile ] ; then \
731 srcroot=`cd $(srcdir); pwd`; export srcroot; \
732 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
737 # These rules are used to check the modules which use FLAGS_TO_PASS.
738 # To build a target check-X means to cd to X and make check. Some
739 # modules are only tested in a native toolchain.
741 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
742 $(NATIVE_CHECK_MODULES):
743 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
744 dir=`echo $@ | sed -e 's/check-//'`; \
745 if [ -f ./$${dir}/Makefile ] ; then \
747 srcroot=`cd $(srcdir); pwd`; export srcroot; \
748 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
754 $(CROSS_CHECK_MODULES):
755 @dir=`echo $@ | sed -e 's/check-//'`; \
756 if [ -f ./$${dir}/Makefile ] ; then \
758 srcroot=`cd $(srcdir); pwd`; export srcroot; \
759 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
764 # This rule is used to install the modules which use FLAGS_TO_PASS.
765 # To build a target install-X means to cd to X and make install.
766 .PHONY: $(INSTALL_MODULES)
767 $(INSTALL_MODULES): install-dirs
768 @dir=`echo $@ | sed -e 's/install-//'`; \
769 if [ -f ./$${dir}/Makefile ] ; then \
771 srcroot=`cd $(srcdir); pwd`; export srcroot; \
772 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
777 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
778 # To build a target all-X means to cd to X and make all.
779 .PHONY: $(ALL_TARGET_MODULES)
780 $(ALL_TARGET_MODULES):
781 @dir=`echo $@ | sed -e 's/all-//'`; \
782 if [ -f ./$${dir}/Makefile ] ; then \
784 srcroot=`cd $(srcdir); pwd`; export srcroot; \
785 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
790 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
791 # To build a target install-X means to cd to X and make install.
792 .PHONY: $(CHECK_TARGET_MODULES)
793 $(CHECK_TARGET_MODULES):
794 @dir=`echo $@ | sed -e 's/check-//'`; \
795 if [ -f ./$${dir}/Makefile ] ; then \
797 srcroot=`cd $(srcdir); pwd`; export srcroot; \
798 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
803 # This rule is used to install the modules which use
804 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
806 .PHONY: $(INSTALL_TARGET_MODULES)
807 $(INSTALL_TARGET_MODULES): install-dirs
808 @dir=`echo $@ | sed -e 's/install-//'`; \
809 if [ -f ./$${dir}/Makefile ] ; then \
811 srcroot=`cd $(srcdir); pwd`; export srcroot; \
812 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
817 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
818 # To build a target all-X means to cd to X and make all.
819 .PHONY: $(ALL_X11_MODULES)
821 @dir=`echo $@ | sed -e 's/all-//'`; \
822 if [ -f ./$${dir}/Makefile ] ; then \
824 srcroot=`cd $(srcdir); pwd`; export srcroot; \
826 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
831 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
832 # To build a target check-X means to cd to X and make all.
833 .PHONY: $(CHECK_X11_MODULES)
834 $(CHECK_X11_MODULES):
835 @dir=`echo $@ | sed -e 's/check-//'`; \
836 if [ -f ./$${dir}/Makefile ] ; then \
838 srcroot=`cd $(srcdir); pwd`; export srcroot; \
840 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
845 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
846 # To build a target install-X means to cd to X and make install.
847 .PHONY: $(INSTALL_X11_MODULES)
848 $(INSTALL_X11_MODULES):
849 @dir=`echo $@ | sed -e 's/install-//'`; \
850 if [ -f ./$${dir}/Makefile ] ; then \
852 srcroot=`cd $(srcdir); pwd`; export srcroot; \
854 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
859 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
862 @if [ -f ./gcc/Makefile ] ; then \
864 srcroot=`cd $(srcdir); pwd`; export srcroot; \
865 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
872 @if [ -f ./gcc/Makefile ] ; then \
874 srcroot=`cd $(srcdir); pwd`; export srcroot; \
875 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
882 @if [ -f ./gcc/Makefile ] ; then \
884 srcroot=`cd $(srcdir); pwd`; export srcroot; \
885 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
892 # This rule is used to install the modules which use FLAGS_TO_PASS.
893 # To build a target install-X means to cd to X and make install.
894 .PHONY: install-dosrel
895 install-dosrel: install-dirs info
896 @dir=`echo $@ | sed -e 's/install-//'`; \
897 if [ -f ./$${dir}/Makefile ] ; then \
899 srcroot=`cd $(srcdir); pwd`; export srcroot; \
900 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
908 # This is a list of inter-dependencies among modules.
911 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
913 # start-sanitize-chill
914 all-chillrt: all-binutils all-gas all-gcc all-newlib
917 all-dejagnu: all-tcl all-expect all-tk
918 all-diff: all-libiberty
920 all-emacs19: all-byacc
922 all-expect: all-tcl all-tk
923 all-fileutils: all-libiberty
925 all-flex: all-libiberty all-byacc
926 all-gas: all-libiberty all-opcodes all-bfd
929 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
930 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim all-gcc all-ld
932 all-gprof: all-libiberty all-bfd
933 all-grep: all-libiberty
934 all-gui: all-gdb all-libproc all-librx
935 all-gzip: all-libiberty
936 all-hello: all-libiberty
938 all-ispell: all-emacs19
939 all-ld: all-libiberty all-bfd all-byacc all-flex
940 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib \
942 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
944 all-libstdc++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib \
946 all-m4: all-libiberty
947 all-make: all-libiberty
949 all-newlib: all-binutils all-gas all-pagas all-gcc
952 all-prms: all-libiberty
955 all-recode: all-libiberty
956 all-sed: all-libiberty
957 all-send-pr: all-prms
959 all-sim: all-libiberty all-bfd
960 all-tar: all-libiberty
962 all-tclX: all-tcl all-tk
964 all-texinfo: all-libiberty
966 all-tgas: all-libiberty all-bfd
969 all-uudecode: all-libiberty
970 all-xiberty: all-gcc all-ld all-newlib
972 ### other supporting targets
981 @for i in $(MAKEDIRS) ; do \
982 echo Making $$i... ; \
983 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
984 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
985 if [ ! -d $$i ] ; then \
986 if mkdir $$i ; then \
997 dir.info: do-install-info
998 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
999 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1000 mv -f dir.info.new dir.info ; \
1005 @echo "Building a full distribution of this tree isn't done"
1006 @echo "via 'make dist'. Check out the etc/ subdirectory"
1010 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1011 # ability to use several tags files at once, so there is probably no need
1012 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1013 # (if we felt like it) have this Makefile write a piece of elisp which
1014 # the user could load to tell emacs19 where all the TAGS files we just
1018 # with the gnu make, this is done automatically.
1020 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1021 $(SHELL) ./config.status
1024 # Support for building net releases
1026 # Files in devo used in any net release.
1027 # ChangeLog omitted because it may refer to files which are not in this
1028 # distribution (perhaps it would be better to include it anyway).
1029 DEVO_SUPPORT= README Makefile.in configure configure.in \
1030 config.guess config.sub config move-if-change \
1031 COPYING COPYING.LIB install.sh
1033 # Files in devo/etc used in any net release.
1034 # ChangeLog omitted because it may refer to files which are not in this
1035 # distribution (perhaps it would be better to include it anyway).
1036 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
1037 configure.texi standards.texi make-stds.texi
1038 ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
1040 # When you use `make setup-dirs' or `make taz' you should always redefine
1042 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1043 # Directories that might want `make diststuff' run.
1044 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
1045 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1046 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1047 # Directories where "info" should be built.
1048 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
1052 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1053 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1054 # Make sure "diststuff" files get built properly.
1055 for f in $(DISTBISONFILES) ; do \
1056 if [ -r $$f ]; then \
1057 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1061 # Take out texinfo from a few places; make simple BISON=bison line.
1062 sed -e '/^all\.normal: /s/\all-texinfo //' \
1063 -e '/^ install-texinfo /d' \
1064 -e '/^BISON = /,/^$$/d' \
1065 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1067 mv -f tmp Makefile.in
1069 $(start-sanitize-Sanitize)
1070 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1071 $(end-sanitize-Sanitize)
1073 # Doc files don't change; include them in distribution.
1074 for f in $(DISTDOCDIRS) ; do \
1075 if [ -r $$f/Makefile ]; then \
1076 (cd $$f ; $(MAKE) info) || exit 1 ; \
1079 # Make links, and run "make diststuff" when needed.
1080 # The `echo' for setting `p' is to convert all whitespace to spaces.
1081 # Then the `case' further below should tell whether $$d is in
1083 rm -rf proto-toplev ; mkdir proto-toplev
1084 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1085 p=" `echo $(DISTSTUFFDIRS)` " ; \
1086 for d in $$dirs ; do \
1087 if [ -d $$d ]; then \
1090 echo making diststuff in $$d ; \
1091 (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1 ;; \
1093 if [ -d $$d/proto-$$d.dir ]; then \
1094 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1096 ln -s ../$$d proto-toplev/$$d ; \
1098 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1102 mkdir proto-toplev/etc
1103 (cd proto-toplev/etc; \
1104 for i in $(ETC_SUPPORT); do \
1105 ln -s ../../etc/$$i . ; \
1107 for i in $(ETC_SUPPORT_PFX); do \
1108 ln -s ../../etc/$$i* . ; \
1111 # Take out texinfo and glob from configurable dirs
1112 rm proto-toplev/configure.in
1113 sed -e '/^host_tools=/s/texinfo //' \
1114 -e '/^host_libs=/s/glob //' \
1115 <configure.in >proto-toplev/configure.in
1117 mkdir proto-toplev/texinfo
1118 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1119 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1120 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1121 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1122 chmod og=u `find . -print`
1123 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1124 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1125 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1126 tar cfh - $(TOOL)-$$VER \
1127 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1129 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1130 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1133 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1134 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1135 $(MAKE) -f Makefile.in taz TOOL=gas \
1136 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1138 # The FSF "binutils" release includes gprof and ld.
1139 .PHONY: binutils.tar.gz
1140 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
1141 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1142 $(MAKE) -f Makefile.in taz TOOL=binutils \
1143 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1145 .PHONY: gas+binutils.tar.gz
1146 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1147 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1148 $(MAKE) -f Makefile.in taz TOOL=gas \
1149 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1151 .PHONY: libg++.tar.gz
1152 LIBGXX_SUPPORT_DIRS=include libio librx libiberty xiberty
1153 libg++.tar.gz: $(DIST_SUPPORT) libg++
1154 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1155 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1157 GNATS_SUPPORT_DIRS=include libiberty send-pr
1158 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1159 $(MAKE) -f Makefile.in taz TOOL=gnats \
1160 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1163 GDB_SUPPORT_DIRS= bfd glob include libiberty mmalloc opcodes readline sim
1164 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1165 $(MAKE) -f Makefile.in taz TOOL=gdb \
1166 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1168 .PHONY: newlib.tar.gz
1169 NEWLIB_SUPPORT_DIRS=
1170 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1171 $(MAKE) -f Makefile.in taz TOOL=newlib \
1172 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1173 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
1174 DISTDOCDIRS="$(DISTDOCDIRS) newlib"
1179 # start-sanitize-chill
1180 ## This is ugly, but I don't want GNU make to put these variables in
1181 ## the environment. Older makes will see this as a set of targets
1182 ## with no dependencies and no actions.
1183 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1184 # end-sanitize-chill
1186 # end of Makefile.in