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
49 INSTALL = $${srcroot}/install.sh -c
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL) -m 644
52 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
54 INSTALL_DOSREL = install-dosrel-fake
61 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
62 # here so that they can be overridden by Makefile fragments.
63 HOST_CC = $(CC_FOR_BUILD)
65 HOST_PREFIX_1 = loser-
67 # We don't specify -g -O because many compilers don't support -g -O,
68 # and/or -O is broken in and of itself.
71 CFLAGS_FOR_TARGET = $(CFLAGS)
72 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
76 # start-sanitize-chill
77 CHILLFLAGS = $(CFLAGS)
82 # Use -O2 to stress test the compiler.
84 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
85 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
86 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
90 # Not plain GZIP, since gzip looks there for extra command-line options.
93 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
94 BISON = `if [ -f $$r/byacc/byacc ] ; \
95 then echo $$r/byacc/byacc ; \
99 LEX = `if [ -f $$r/flex/flex ] ; \
100 then echo $$r/flex/flex ; \
103 M4 = `if [ -f $$r/m4/m4 ] ; \
104 then echo $$r/m4/m4 ; \
107 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
108 then echo $$r/texinfo/makeinfo/makeinfo ; \
109 else echo makeinfo ; fi`
111 # This just becomes part of the MAKEINFO definition passed down to
112 # sub-makes. It lets flags be given on the command line while still
113 # using the makeinfo from the object tree.
116 EXPECT = `if [ -f $$r/expect/expect ] ; \
117 then echo $$r/expect/expect ; \
118 else echo expect ; fi`
120 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
121 then echo $${srcroot}/dejagnu/runtest ; \
122 else echo runtest ; fi`
125 # libraries that may need to be augmented on a system-by-system basis
128 # compilers to use to create programs which must be run in the build
131 CXX_FOR_BUILD = $(CXX)
133 SUBDIRS = "this is set via configure, don't edit this"
137 INSTALL_TARGET = install-dirs \
139 $(INSTALL_TARGET_MODULES) \
140 $(INSTALL_X11_MODULES) \
146 if [ -f $$r/gcc/Makefile ] ; then \
147 if [ -f $$r/newlib/Makefile ] ; then \
148 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
150 echo $$r/gcc/xgcc -B$$r/gcc/; \
153 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
156 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
160 # start-sanitize-chill
161 CHILL_FOR_TARGET = ` \
162 if [ -f $$r/gcc/Makefile ] ; then \
163 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
165 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
168 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
175 if [ -f $$r/gcc/Makefile ] ; then \
176 if [ -f $$r/newlib/Makefile ] ; then \
177 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
179 echo $$r/gcc/xgcc -B$$r/gcc/; \
182 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
185 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
190 if [ -f $$r/gas/as.new ] ; then \
191 echo $$r/gas/as.new ; \
193 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
196 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
201 if [ -f $$r/binutils/ar ] ; then \
202 echo $$r/binutils/ar ; \
204 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
207 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
211 RANLIB_FOR_TARGET = ` \
212 if [ -f $$r/binutils/ranlib ] ; then \
213 echo $$r/binutils/ranlib ; \
215 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
218 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
223 if [ -f $$r/binutils/nm.new ] ; then \
224 echo $$r/binutils/nm.new ; \
226 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
229 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
233 #### host and target specific makefile fragments come in here.
236 # Flags to pass down to all sub-makes.
237 # Please keep these in alphabetical order.
238 BASE_FLAGS_TO_PASS = \
239 "AR_FLAGS=$(AR_FLAGS)" \
240 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
241 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
243 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
244 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
246 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
247 $(start-sanitize-chill)\
248 "CHILLFLAGS=$(CHILLFLAGS)" \
249 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
250 "CHILL_LIB=$(CHILL_LIB)" \
251 $(end-sanitize-chill)\
252 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
253 "CXXFLAGS=$(CXXFLAGS)" \
254 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
255 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
256 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
257 "INSTALL=$(INSTALL)" \
258 "INSTALL_DATA=$(INSTALL_DATA)" \
259 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
260 "INSTALL_XFORM=$(INSTALL_XFORM)" \
261 "LDFLAGS=$(LDFLAGS)" \
263 "LIBCFLAGS=$(LIBCFLAGS)" \
264 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
265 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
266 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
268 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
269 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
270 "PICFLAG=$(PICFLAG)" \
271 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
272 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
275 "RUNTEST=$(RUNTEST)" \
276 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
278 "exec_prefix=$(exec_prefix)" \
282 # Flags to pass down to most sub-makes, in which we're building with
283 # the host environment.
284 # If any variables are added here, they must be added to do-*, below.
293 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
295 # Flags that are concerned with the location of the X11 include files
297 X11_FLAGS_TO_PASS = \
298 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
299 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
302 # Flags to pass down to makes which are built with the target environment.
303 # The double $ decreases the length of the command line; the variables
304 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
305 # If any variables are added here, they must be added to do-*, below.
306 EXTRA_TARGET_FLAGS = \
307 'AR=$$(AR_FOR_TARGET)' \
308 'AS=$$(AS_FOR_TARGET)' \
309 'CC=$$(CC_FOR_TARGET)' \
310 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
311 'CXX=$$(CXX_FOR_TARGET)' \
312 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
313 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
314 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
315 'NM=$$(NM_FOR_TARGET)' \
316 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
317 'RANLIB=$$(RANLIB_FOR_TARGET)'
319 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
321 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
322 # unfortunately needs the native compiler and the target ar and
324 # If any variables are added here, they must be added to do-*, below.
325 # The HOST_* variables are a special case, which are used for the gcc
326 # cross-building scheme.
328 'AR=$$(AR_FOR_TARGET)' \
332 'HOST_CC=$(CC_FOR_BUILD)' \
333 'HOST_PREFIX=$(HOST_PREFIX)' \
334 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
336 'RANLIB=$$(RANLIB_FOR_TARGET)'
338 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
340 # This is a list of the targets for all of the modules which are compiled
341 # using $(FLAGS_TO_PASS).
388 # This is a list of the check targets for all of the modules which are
389 # compiled using $(FLAGS_TO_PASS).
390 # This is a list of the check targets for all of the modules which are
391 # compiled using $(FLAGS_TO_PASS).
393 # The list is in two parts. The first lists those tools which
394 # are tested as part of the host's native tool-chain, and not
395 # tested in a cross configuration.
396 NATIVE_CHECK_MODULES = \
400 CROSS_CHECK_MODULES = \
442 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
444 # This is a list of the install targets for all of the modules which are
445 # compiled using $(FLAGS_TO_PASS).
491 # This is a list of the targets for all of the modules which are compiled
492 # using $(X11_FLAGS_TO_PASS).
502 # This is a list of the check targets for all of the modules which are
503 # compiled using $(X11_FLAGS_TO_PASS).
504 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 = \
523 # This is a list of the targets for all of the modules which are compiled
524 # using $(TARGET_FLAGS_TO_PASS).
525 ALL_TARGET_MODULES = \
526 $(start-sanitize-chill) \
528 $(end-sanitize-chill) \
537 # This is a list of the check targets for all of the modules which are
538 # compiled using $(TARGET_FLAGS_TO_PASS).
539 CHECK_TARGET_MODULES = \
540 $(start-sanitize-chill) \
542 $(end-sanitize-chill) \
549 # This is a list of the install targets for all of the modules which are
550 # compiled using $(TARGET_FLAGS_TO_PASS).
551 INSTALL_TARGET_MODULES = \
552 $(start-sanitize-chill) \
554 $(end-sanitize-chill) \
562 # This is a shell case of all modules which are compiled using
563 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
564 TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty
565 # start-sanitize-chill
566 TARGET_LIBS = chillrt | libio | libstdc++ | librx | libg++ | newlib | xiberty
569 # The first rule in the file had better be this one. Don't put any above it.
573 # The target built for a native build.
577 $(ALL_TARGET_MODULES) \
581 # Do a target for all the subdirectories. A ``make do-X'' will do a
582 # ``make X'' in all subdirectories (because, in general, there is a
583 # dependency (below) of X upon do-X, a ``make X'' will also do this,
584 # but it may do additional work as well).
585 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
586 # because it is so large that it can easily overflow the command line
587 # length limit on some systems.
600 @target=`echo $@ | sed -e 's/^do-//'`; \
602 srcroot=`cd $(srcdir); pwd`; export srcroot; \
603 for i in $(SUBDIRS); do \
604 if [ -f ./$$i/Makefile ]; then \
607 for flag in $(EXTRA_TARGET_FLAGS); do \
608 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
612 for flag in $(EXTRA_GCC_FLAGS); do \
613 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
617 for flag in $(EXTRA_HOST_FLAGS); do \
618 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
622 export AR AS CC CXX NM RANLIB; \
624 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
625 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
626 "RANLIB=$${RANLIB}" \
628 then true; else exit 1; fi; \
632 # Here are the targets which correspond to the do-X targets.
634 .PHONY: info installcheck dvi install-info
635 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
637 installcheck: do-installcheck
640 install-info: do-install-info dir.info
641 srcroot=`cd $(srcdir); pwd`; export srcroot; \
642 if [ -f dir.info ] ; then \
643 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
647 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
650 -rm -f Makefile config.status
652 clean: do-clean local-clean
653 mostlyclean: do-mostlyclean local-clean
654 distclean: do-distclean local-clean local-distclean
655 realclean: do-realclean local-clean local-distclean
660 check: $(CHECK_MODULES) \
661 $(CHECK_TARGET_MODULES) \
662 $(CHECK_X11_MODULES) \
665 # Installation targets.
667 .PHONY: install uninstall source-vault binary-vault vault-install
668 install: $(INSTALL_TARGET)
671 @echo "the uninstall target is not supported in this tree"
674 $(MAKE) -f ./release/Build-A-Release \
675 host=$(host_alias) source-vault
678 $(MAKE) -f ./release/Build-A-Release \
679 host=$(host_alias) target=$(target_alias)
682 @if [ -f ./release/vault-install ] ; then \
683 ./release/vault-install $(host_alias) $(target_alias) ; \
689 install.all: install-no-fixedincludes
690 @if [ -f ./gcc/Makefile ] ; then \
691 r=`pwd` ; export r ; \
693 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
698 # install-no-fixedincludes is used because Cygnus can not distribute
699 # the fixed header files.
700 .PHONY: install-no-fixedincludes
701 install-no-fixedincludes: \
704 $(INSTALL_TARGET_MODULES) \
705 $(INSTALL_X11_MODULES) \
708 # Install the gcc headers files, but not the fixed include files,
709 # which Cygnus is not allowed to distribute. This rule is very
710 # dependent on the workings of the gcc Makefile.in.
711 .PHONY: gcc-no-fixedincludes
712 gcc-no-fixedincludes:
713 @if [ -f ./gcc/Makefile ]; then \
714 rm -rf gcc/tmp-include; \
715 mv gcc/include gcc/tmp-include 2>/dev/null; \
717 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
718 touch gcc/stmp-fixinc gcc/include/fixed; \
719 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
721 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
723 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
724 rm -rf gcc/include; \
725 mv gcc/tmp-include gcc/include 2>/dev/null; \
728 # This rule is used to build the modules which use FLAGS_TO_PASS. To
729 # build a target all-X means to cd to X and make all.
731 # all-gui, and all-libproc are handled specially because
732 # they are still experimental, and if they fail to build, that
733 # shouldn't stop "make all".
734 .PHONY: $(ALL_MODULES) all-gui all-libproc
735 $(ALL_MODULES) all-gui all-libproc:
736 @dir=`echo $@ | sed -e 's/all-//'`; \
737 if [ -f ./$${dir}/Makefile ] ; then \
739 srcroot=`cd $(srcdir); pwd`; export srcroot; \
740 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
745 # These rules are used to check the modules which use FLAGS_TO_PASS.
746 # To build a target check-X means to cd to X and make check. Some
747 # modules are only tested in a native toolchain.
749 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
750 $(NATIVE_CHECK_MODULES):
751 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
752 dir=`echo $@ | sed -e 's/check-//'`; \
753 if [ -f ./$${dir}/Makefile ] ; then \
755 srcroot=`cd $(srcdir); pwd`; export srcroot; \
756 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
762 $(CROSS_CHECK_MODULES):
763 @dir=`echo $@ | sed -e 's/check-//'`; \
764 if [ -f ./$${dir}/Makefile ] ; then \
766 srcroot=`cd $(srcdir); pwd`; export srcroot; \
767 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
772 # This rule is used to install the modules which use FLAGS_TO_PASS.
773 # To build a target install-X means to cd to X and make install.
774 .PHONY: $(INSTALL_MODULES)
775 $(INSTALL_MODULES): install-dirs
776 @dir=`echo $@ | sed -e 's/install-//'`; \
777 if [ -f ./$${dir}/Makefile ] ; then \
779 srcroot=`cd $(srcdir); pwd`; export srcroot; \
780 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
785 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
786 # To build a target all-X means to cd to X and make all.
787 .PHONY: $(ALL_TARGET_MODULES)
788 $(ALL_TARGET_MODULES):
789 @dir=`echo $@ | sed -e 's/all-//'`; \
790 if [ -f ./$${dir}/Makefile ] ; then \
792 srcroot=`cd $(srcdir); pwd`; export srcroot; \
793 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
798 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
799 # To build a target install-X means to cd to X and make install.
800 .PHONY: $(CHECK_TARGET_MODULES)
801 $(CHECK_TARGET_MODULES):
802 @dir=`echo $@ | sed -e 's/check-//'`; \
803 if [ -f ./$${dir}/Makefile ] ; then \
805 srcroot=`cd $(srcdir); pwd`; export srcroot; \
806 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
811 # This rule is used to install the modules which use
812 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
814 .PHONY: $(INSTALL_TARGET_MODULES)
815 $(INSTALL_TARGET_MODULES): install-dirs
816 @dir=`echo $@ | sed -e 's/install-//'`; \
817 if [ -f ./$${dir}/Makefile ] ; then \
819 srcroot=`cd $(srcdir); pwd`; export srcroot; \
820 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
825 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
826 # To build a target all-X means to cd to X and make all.
827 .PHONY: $(ALL_X11_MODULES)
829 @dir=`echo $@ | sed -e 's/all-//'`; \
830 if [ -f ./$${dir}/Makefile ] ; then \
832 srcroot=`cd $(srcdir); pwd`; export srcroot; \
834 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
839 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
840 # To build a target check-X means to cd to X and make all.
841 .PHONY: $(CHECK_X11_MODULES)
842 $(CHECK_X11_MODULES):
843 @dir=`echo $@ | sed -e 's/check-//'`; \
844 if [ -f ./$${dir}/Makefile ] ; then \
846 srcroot=`cd $(srcdir); pwd`; export srcroot; \
848 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
853 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
854 # To build a target install-X means to cd to X and make install.
855 .PHONY: $(INSTALL_X11_MODULES)
856 $(INSTALL_X11_MODULES):
857 @dir=`echo $@ | sed -e 's/install-//'`; \
858 if [ -f ./$${dir}/Makefile ] ; then \
860 srcroot=`cd $(srcdir); pwd`; export srcroot; \
862 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
867 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
870 @if [ -f ./gcc/Makefile ] ; then \
872 srcroot=`cd $(srcdir); pwd`; export srcroot; \
873 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
880 @if [ -f ./gcc/Makefile ] ; then \
882 srcroot=`cd $(srcdir); pwd`; export srcroot; \
883 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
890 @if [ -f ./gcc/Makefile ] ; then \
892 srcroot=`cd $(srcdir); pwd`; export srcroot; \
893 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
900 # This rule is used to install the modules which use FLAGS_TO_PASS.
901 # To build a target install-X means to cd to X and make install.
902 .PHONY: install-dosrel
903 install-dosrel: install-dirs info
904 @dir=`echo $@ | sed -e 's/install-//'`; \
905 if [ -f ./$${dir}/Makefile ] ; then \
907 srcroot=`cd $(srcdir); pwd`; export srcroot; \
908 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
916 # This is a list of inter-dependencies among modules.
919 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
921 # start-sanitize-chill
922 all-chillrt: all-binutils all-gas all-gcc all-newlib
925 all-dejagnu: all-tcl all-expect all-tk
926 all-diff: all-libiberty
928 all-emacs19: all-byacc
930 all-expect: all-tcl all-tk
931 all-fileutils: all-libiberty
933 all-flex: all-libiberty all-byacc
934 all-gas: all-libiberty all-opcodes all-bfd
937 all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
938 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements)
939 all-gprof: all-libiberty all-bfd
940 all-grep: all-libiberty
941 all-gui: all-gdb all-libproc all-librx
942 all-gzip: all-libiberty
943 all-hello: all-libiberty
945 all-ispell: all-emacs19
946 all-ld: all-libiberty all-bfd all-byacc all-flex
947 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
948 all-libio: all-gas all-ld all-gcc all-xiberty all-newlib
950 all-libstdc++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio
951 all-m4: all-libiberty
952 all-make: all-libiberty
954 all-newlib: all-binutils all-gas all-gcc
957 all-prms: all-libiberty
960 all-recode: all-libiberty
961 all-sed: all-libiberty
962 all-send-pr: all-prms
964 all-sim: all-libiberty all-bfd
965 all-tar: all-libiberty
967 all-tclX: all-tcl all-tk
969 all-texinfo: all-libiberty
971 all-tgas: all-libiberty all-bfd
974 all-uudecode: all-libiberty
975 all-xiberty: all-gcc all-ld all-newlib
977 ### other supporting targets
986 @for i in $(MAKEDIRS) ; do \
987 echo Making $$i... ; \
988 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
989 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
990 if [ ! -d $$i ] ; then \
991 if mkdir $$i ; then \
1002 dir.info: do-install-info
1003 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1004 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1005 mv -f dir.info.new dir.info ; \
1010 @echo "Building a full distribution of this tree isn't done"
1011 @echo "via 'make dist'. Check out the etc/ subdirectory"
1015 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1016 # ability to use several tags files at once, so there is probably no need
1017 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1018 # (if we felt like it) have this Makefile write a piece of elisp which
1019 # the user could load to tell emacs19 where all the TAGS files we just
1023 # with the gnu make, this is done automatically.
1025 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1026 $(SHELL) ./config.status
1029 # Support for building net releases
1031 # Files in devo used in any net release.
1032 # ChangeLog omitted because it may refer to files which are not in this
1033 # distribution (perhaps it would be better to include it anyway).
1034 DEVO_SUPPORT= README Makefile.in configure configure.in \
1035 config.guess config.sub config move-if-change \
1036 COPYING COPYING.LIB install.sh
1038 # Files in devo/etc used in any net release.
1039 # ChangeLog omitted because it may refer to files which are not in this
1040 # distribution (perhaps it would be better to include it anyway).
1041 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
1042 configure.texi standards.texi make-stds.texi
1043 ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
1045 # When you use `make setup-dirs' or `make taz' you should always redefine
1047 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1048 # Directories that might want `make diststuff' run.
1049 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
1050 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1051 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1052 # Directories where "info" should be built.
1053 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
1057 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1058 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1059 # Make sure "diststuff" files get built properly.
1060 for f in $(DISTBISONFILES) ; do \
1061 if [ -r $$f ]; then \
1062 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1066 # Take out texinfo from a few places; make simple BISON=bison line.
1067 sed -e '/^all\.normal: /s/\all-texinfo //' \
1068 -e '/^ install-texinfo /d' \
1069 -e '/^BISON = /,/^$$/d' \
1070 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1072 mv -f tmp Makefile.in
1074 $(start-sanitize-Sanitize)
1075 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1076 $(end-sanitize-Sanitize)
1078 # Doc files don't change; include them in distribution.
1079 for f in $(DISTDOCDIRS) ; do \
1080 if [ -r $$f/Makefile ]; then \
1081 (cd $$f ; $(MAKE) info) || exit 1 ; \
1084 # Make links, and run "make diststuff" when needed.
1085 # The `echo' for setting `p' is to convert all whitespace to spaces.
1086 # Then the `case' further below should tell whether $$d is in
1088 rm -rf proto-toplev ; mkdir proto-toplev
1089 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1090 p=" `echo $(DISTSTUFFDIRS)` " ; \
1091 for d in $$dirs ; do \
1092 if [ -d $$d ]; then \
1095 (cd $$d ; $(MAKE) diststuff ) || exit 1 ;; \
1097 if [ -d $$d/proto-$$d.dir ]; then \
1098 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1100 ln -s ../$$d proto-toplev/$$d ; \
1102 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1106 mkdir proto-toplev/etc
1107 (cd proto-toplev/etc; \
1108 for i in $(ETC_SUPPORT); do \
1109 ln -s ../../etc/$$i . ; \
1111 for i in $(ETC_SUPPORT_PFX); do \
1112 ln -s ../../etc/$$i* . ; \
1115 # Take out texinfo from configurable dirs
1116 rm proto-toplev/configure.in
1117 sed -e '/^host_tools=/s/texinfo //' \
1118 <configure.in >proto-toplev/configure.in
1120 mkdir proto-toplev/texinfo
1121 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1122 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1123 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1124 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1125 chmod og=u `find . -print`
1126 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1127 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1128 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1129 tar cfh - $(TOOL)-$$VER \
1130 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1132 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1133 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1136 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1137 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1138 $(MAKE) -f Makefile.in taz TOOL=gas \
1139 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1141 # The FSF "binutils" release includes gprof and ld.
1142 .PHONY: binutils.tar.gz
1143 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
1144 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1145 $(MAKE) -f Makefile.in taz TOOL=binutils \
1146 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1148 .PHONY: gas+binutils.tar.gz
1149 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1150 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1151 $(MAKE) -f Makefile.in taz TOOL=gas \
1152 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1154 .PHONY: libg++.tar.gz
1155 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty xiberty
1156 libg++.tar.gz: $(DIST_SUPPORT) libg++
1157 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1158 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1160 GNATS_SUPPORT_DIRS=include libiberty send-pr
1161 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1162 $(MAKE) -f Makefile.in taz TOOL=gnats \
1163 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1166 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim
1167 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1168 $(MAKE) -f Makefile.in taz TOOL=gdb \
1169 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1171 .PHONY: newlib.tar.gz
1172 NEWLIB_SUPPORT_DIRS=
1173 # taz configures for the sun4 target which won't configure newlib.
1174 # compensate here by configuring newlib for a simple (no multilib support)
1175 # cross target (sparc64).
1176 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1178 cd newlib && ../configure --srcdir $$rootme/newlib \
1179 --host sun4 --target sparc64-elf
1180 $(MAKE) -f Makefile.in taz TOOL=newlib \
1181 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1182 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
1183 DISTDOCDIRS="$(DISTDOCDIRS) newlib"
1188 # start-sanitize-chill
1189 ## This is ugly, but I don't want GNU make to put these variables in
1190 ## the environment. Older makes will see this as a set of targets
1191 ## with no dependencies and no actions.
1192 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1193 # end-sanitize-chill
1195 # end of Makefile.in