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)'
58 # We don't specify -g -O because many compilers don't support -g -O,
59 # and/or -O is broken in and of itself.
62 # start-sanitize-chill
63 CHILLFLAGS = $(CFLAGS)
68 # Use -O to stress test the compiler.
74 # Not plain GZIP, since gzip looks there for extra command-line options.
77 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
78 BISON = `if [ -f $$r/byacc/byacc ] ; \
79 then echo $$r/byacc/byacc ; \
83 LEX = `if [ -f $$r/flex/flex ] ; \
84 then echo $$r/flex/flex ; \
87 M4 = `if [ -f $$r/m4/m4 ] ; \
88 then echo $$r/m4/m4 ; \
91 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
92 then echo $$r/texinfo/makeinfo/makeinfo ; \
93 else echo makeinfo ; fi`
95 # This just becomes part of the MAKEINFO definition passed down to
96 # sub-makes. It lets flags be given on the command line while still
97 # using the makeinfo from the object tree.
100 EXPECT = `if [ -f $$r/expect/expect ] ; \
101 then echo $$r/expect/expect ; \
102 else echo expect ; fi`
104 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
105 then echo $${srcroot}/dejagnu/runtest ; \
106 else echo runtest ; fi`
109 # libraries that may need to be augmented on a system-by-system basis
112 # compilers to use to create programs which must be run in the build
115 CXX_FOR_BUILD = $(CXX)
117 SUBDIRS = "this is set via configure, don't edit this"
121 INSTALL_TARGET = install-dirs \
123 $(INSTALL_TARGET_MODULES) \
124 $(INSTALL_X11_MODULES) \
128 if [ -f $$r/gcc/Makefile ] ; then \
129 echo $$r/gcc/xgcc -B$$r/gcc/; \
131 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
134 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
138 # start-sanitize-chill
139 CHILL_FOR_TARGET = ` \
140 if [ -f $$r/gcc/Makefile ] ; then \
141 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
143 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
146 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
153 if [ -f $$r/gcc/Makefile ] ; then \
154 echo $$r/gcc/xgcc -B$$r/gcc/; \
156 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
159 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
164 if [ -f $$r/gas/Makefile ] ; then \
165 echo $$r/gas/as.new ; \
167 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
170 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
175 if [ -f $$r/binutils/ar ] ; then \
176 echo $$r/binutils/ar ; \
178 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
181 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
185 RANLIB_FOR_TARGET = ` \
186 if [ -f $$r/binutils/ranlib ] ; then \
187 echo $$r/binutils/ranlib ; \
189 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
192 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
197 if [ -f $$r/binutils/Makefile ] ; then \
198 echo $$r/binutils/nm ; \
200 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
203 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
207 # FIXME: This is badly named.
209 if [ -f $$r/gcc/Makefile ] ; then \
210 if [ -f $$r/newlib/Makefile ] ; then \
211 echo -I$$r/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$$r/gcc/include -nostdinc ; \
213 echo -I$$r/gcc/include ; \
219 #### host and target specific makefile fragments come in here.
222 # Flags to pass down to all sub-makes.
223 # Please keep these in alphabetical order.
224 BASE_FLAGS_TO_PASS = \
225 "AR_FLAGS=$(AR_FLAGS)" \
226 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
227 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
229 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
230 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
232 $(start-sanitize-chill)\
233 "CHILLFLAGS=$(CHILLFLAGS)" \
234 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
235 "CHILL_LIB=$(CHILL_LIB)" \
236 $(end-sanitize-chill)\
237 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
238 "CXXFLAGS=$(CXXFLAGS)" \
239 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
240 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
241 "INSTALL=$(INSTALL)" \
242 "INSTALL_DATA=$(INSTALL_DATA)" \
243 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
244 "INSTALL_XFORM=$(INSTALL_XFORM)" \
245 "LDFLAGS=$(LDFLAGS)" \
248 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
249 "MUNCH_NM=$(MUNCH_NM)" \
250 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
251 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
254 "RUNTEST=$(RUNTEST)" \
255 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
256 "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
258 "exec_prefix=$(exec_prefix)" \
262 # Flags to pass down to most sub-makes, in which we're building with
263 # the host environment.
264 # If any variables are added here, they must be added to do-*, below.
274 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
276 # Flags that are concerned with the location of the X11 include files
278 X11_FLAGS_TO_PASS = \
279 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
280 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
283 # Flags to pass down to makes which are built with the target environment.
284 # The double $ decreases the length of the command line; the variables
285 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
286 # If any variables are added here, they must be added to do-*, below.
287 EXTRA_TARGET_FLAGS = \
288 'AR=$$(AR_FOR_TARGET)' \
289 'AS=$$(AS_FOR_TARGET)' \
290 'CC=$$(CC_FOR_TARGET)' \
291 'CXX=$$(CXX_FOR_TARGET)' \
292 'NM=$$(NM_FOR_TARGET)' \
293 'RANLIB=$$(RANLIB_FOR_TARGET)' \
294 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
296 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
298 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
299 # unfortunately needs the native compiler and the target ar and
301 # If any variables are added here, they must be added to do-*, below.
302 # The HOST_* variables are a special case, which are used for the gcc
303 # cross-building scheme.
304 HOST_CC = $(CC_FOR_BUILD)
306 HOST_PREFIX_1 = loser-
308 'AR=$$(AR_FOR_TARGET)' \
312 'HOST_CC=$(CC_FOR_BUILD)' \
313 'HOST_PREFIX=$(HOST_PREFIX)' \
314 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
316 'RANLIB=$$(RANLIB_FOR_TARGET)' \
319 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
321 # This is a list of the targets for all of the modules which are compiled
322 # using $(FLAGS_TO_PASS).
371 # This is a list of the check targets for all of the modules which are
372 # compiled using $(FLAGS_TO_PASS).
419 # This is a list of the install targets for all of the modules which are
420 # compiled using $(FLAGS_TO_PASS).
468 # This is a list of the targets for all of the modules which are compiled
469 # using $(X11_FLAGS_TO_PASS).
477 # This is a list of the check targets for all of the modules which are
478 # compiled using $(X11_FLAGS_TO_PASS).
479 CHECK_X11_MODULES = \
486 # This is a list of the install targets for all the modules which are
487 # compiled using $(X11_FLAGS_TO_PASS).
488 INSTALL_X11_MODULES = \
495 # This is a list of the targets for all of the modules which are compiled
496 # using $(TARGET_FLAGS_TO_PASS).
497 ALL_TARGET_MODULES = \
498 $(start-sanitize-chill) \
500 $(end-sanitize-chill) \
506 # This is a list of the check targets for all of the modules which are
507 # compiled using $(TARGET_FLAGS_TO_PASS).
508 CHECK_TARGET_MODULES = \
509 $(start-sanitize-chill) \
511 $(end-sanitize-chill) \
517 # This is a list of the install targets for all of the modules which are
518 # compiled using $(TARGET_FLAGS_TO_PASS).
519 INSTALL_TARGET_MODULES = \
520 $(start-sanitize-chill) \
522 $(end-sanitize-chill) \
528 # This is a shell case of all modules which are compiled using
529 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
530 TARGET_LIBS = libio | libg++ | newlib | xiberty
531 # start-sanitize-chill
532 TARGET_LIBS = chillrt | libio | libg++ | newlib | xiberty
535 # The first rule in the file had better be this one. Don't put any above it.
539 # The target built for a native build.
543 $(ALL_TARGET_MODULES) \
547 # Do a target for all the subdirectories. A ``make do-X'' will do a
548 # ``make X'' in all subdirectories (because, in general, there is a
549 # dependency (below) of X upon do-X, a ``make X'' will also do this,
550 # but it may do additional work as well).
551 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
552 # because it is so large that it can easily overflow the command line
553 # length limit on some systems.
565 @target=`echo $@ | sed -e 's/^do-//'`; \
567 srcroot=`cd $(srcdir); pwd`; export srcroot; \
568 for i in $(SUBDIRS); do \
569 if [ -f ./$$i/Makefile ]; then \
572 for flag in $(EXTRA_TARGET_FLAGS); do \
573 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
577 for flag in $(EXTRA_GCC_FLAGS); do \
578 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
582 for flag in $(EXTRA_HOST_FLAGS); do \
583 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
587 export AR AS CC CXX NM RANLIB XTRAFLAGS; \
589 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
590 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
591 "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
593 then true; else exit 1; fi; \
597 # Here are the targets which correspond to the do-X targets.
599 .PHONY: info installcheck dvi install-info
600 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
602 installcheck: do-installcheck
605 install-info: do-install-info dir.info
606 srcroot=`cd $(srcdir); pwd`; export srcroot; \
607 if [ -f dir.info ] ; then \
608 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
612 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
615 -rm -f Makefile config.status
617 clean: do-clean local-clean
618 mostlyclean: do-mostlyclean local-clean
619 distclean: do-distclean local-clean local-distclean
620 realclean: do-realclean local-clean local-distclean
625 check: $(CHECK_MODULES) \
626 $(CHECK_TARGET_MODULES) \
627 $(CHECK_X11_MODULES) \
630 # Installation targets.
632 .PHONY: install uninstall vault-install
633 install: $(INSTALL_TARGET)
636 @echo "the uninstall target is not supported in this tree"
639 @if [ -f ./release/vault-install ] ; then \
640 ./release/vault-install $(host_alias) $(target_alias) ; \
646 install.all: install-no-fixedincludes
647 @if [ -f ./gcc/Makefile ] ; then \
648 r=`pwd` ; export r ; \
650 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
655 # install-no-fixedincludes is used because Cygnus can not distribute
656 # the fixed header files.
657 .PHONY: install-no-fixedincludes
658 install-no-fixedincludes: \
661 $(INSTALL_TARGET_MODULES) \
662 $(INSTALL_X11_MODULES) \
665 # Install the gcc headers files, but not the fixed include files,
666 # which Cygnus is not allowed to distribute. This rule is very
667 # dependent on the workings of the gcc Makefile.in.
668 .PHONY: gcc-no-fixedincludes
669 gcc-no-fixedincludes:
670 @if [ -f ./gcc/Makefile ]; then \
671 rm -rf gcc/tmp-include; \
672 mv gcc/include gcc/tmp-include 2>/dev/null; \
674 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
675 touch gcc/stmp-fixinc gcc/stmp-fixproto; \
676 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
678 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
680 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
681 rm -rf gcc/include; \
682 mv gcc/tmp-include gcc/include 2>/dev/null; \
685 # This rule is used to build the modules which use FLAGS_TO_PASS. To
686 # build a target all-X means to cd to X and make all.
687 # all-glob is handled specially because it doesn't actually build.
688 .PHONY: $(ALL_MODULES) all-glob
689 $(ALL_MODULES) all-glob:
690 @dir=`echo $@ | sed -e 's/all-//'`; \
691 if [ -f ./$${dir}/Makefile ] ; then \
693 srcroot=`cd $(srcdir); pwd`; export srcroot; \
694 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
699 # This rule is used to check the modules which use FLAGS_TO_PASS. To
700 # build a target check-X means to cd to X and make all.
701 .PHONY: $(CHECK_MODULES)
703 @dir=`echo $@ | sed -e 's/check-//'`; \
704 if [ -f ./$${dir}/Makefile ] ; then \
706 srcroot=`cd $(srcdir); pwd`; export srcroot; \
707 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
712 # This rule is used to install the modules which use FLAGS_TO_PASS.
713 # To build a target install-X means to cd to X and make install.
714 .PHONY: $(INSTALL_MODULES)
715 $(INSTALL_MODULES): install-dirs
716 @dir=`echo $@ | sed -e 's/install-//'`; \
717 if [ -f ./$${dir}/Makefile ] ; then \
719 srcroot=`cd $(srcdir); pwd`; export srcroot; \
720 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
725 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
726 # To build a target all-X means to cd to X and make all.
727 .PHONY: $(ALL_TARGET_MODULES)
728 $(ALL_TARGET_MODULES):
729 @dir=`echo $@ | sed -e 's/all-//'`; \
730 if [ -f ./$${dir}/Makefile ] ; then \
732 srcroot=`cd $(srcdir); pwd`; export srcroot; \
733 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
738 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
739 # To build a target install-X means to cd to X and make install.
740 .PHONY: $(CHECK_TARGET_MODULES)
741 $(CHECK_TARGET_MODULES):
742 @dir=`echo $@ | sed -e 's/check-//'`; \
743 if [ -f ./$${dir}/Makefile ] ; then \
745 srcroot=`cd $(srcdir); pwd`; export srcroot; \
746 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
751 # This rule is used to install the modules which use
752 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
754 .PHONY: $(INSTALL_TARGET_MODULES)
755 $(INSTALL_TARGET_MODULES): install-dirs
756 @dir=`echo $@ | sed -e 's/install-//'`; \
757 if [ -f ./$${dir}/Makefile ] ; then \
759 srcroot=`cd $(srcdir); pwd`; export srcroot; \
760 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
765 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
766 # To build a target all-X means to cd to X and make all.
767 .PHONY: $(ALL_X11_MODULES)
769 @dir=`echo $@ | sed -e 's/all-//'`; \
770 if [ -f ./$${dir}/Makefile ] ; then \
772 srcroot=`cd $(srcdir); pwd`; export srcroot; \
774 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
779 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
780 # To build a target check-X means to cd to X and make all.
781 .PHONY: $(CHECK_X11_MODULES)
782 $(CHECK_X11_MODULES):
783 @dir=`echo $@ | sed -e 's/check-//'`; \
784 if [ -f ./$${dir}/Makefile ] ; then \
786 srcroot=`cd $(srcdir); pwd`; export srcroot; \
788 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
793 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
794 # To build a target install-X means to cd to X and make install.
795 .PHONY: $(INSTALL_X11_MODULES)
796 $(INSTALL_X11_MODULES):
797 @dir=`echo $@ | sed -e 's/install-//'`; \
798 if [ -f ./$${dir}/Makefile ] ; then \
800 srcroot=`cd $(srcdir); pwd`; export srcroot; \
802 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
807 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
810 @if [ -f ./gcc/Makefile ] ; then \
812 srcroot=`cd $(srcdir); pwd`; export srcroot; \
813 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
820 @if [ -f ./gcc/Makefile ] ; then \
822 srcroot=`cd $(srcdir); pwd`; export srcroot; \
823 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
830 @if [ -f ./gcc/Makefile ] ; then \
832 srcroot=`cd $(srcdir); pwd`; export srcroot; \
833 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
838 # This is a list of inter-dependencies among modules.
841 all-binutils: all-libiberty all-opcodes all-bfd all-flex
843 # start-sanitize-chill
844 all-chillrt: all-binutils all-gas all-gcc all-newlib
848 all-diff: all-libiberty
851 all-expect: all-tcl all-tk
852 all-fileutils: all-libiberty
854 all-flex: all-libiberty all-byacc
855 all-gas: all-libiberty all-opcodes all-bfd
858 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
859 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
861 all-gprof: all-libiberty all-bfd
862 all-grep: all-libiberty
863 all-gzip: all-libiberty
864 all-hello: all-libiberty
866 all-ispell: all-emacs
867 all-ld: all-libiberty all-bfd all-byacc all-flex
868 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
869 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
871 all-m4: all-libiberty
872 all-make: all-libiberty
874 all-newlib: all-binutils all-gas all-pagas all-gcc
877 all-prms: all-libiberty
880 all-recode: all-libiberty
881 all-sed: all-libiberty
882 all-send-pr: all-prms
884 all-sim: all-libiberty all-bfd
885 all-tar: all-libiberty
887 all-tclX: all-tcl all-tk
889 all-texinfo: all-libiberty
891 all-tgas: all-libiberty all-bfd
894 all-uudecode: all-libiberty
895 all-xiberty: all-gcc all-newlib
897 ### other supporting targets
906 @for i in $(MAKEDIRS) ; do \
907 echo Making $$i... ; \
908 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
909 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
910 if [ ! -d $$i ] ; then \
911 if mkdir $$i ; then \
922 dir.info: do-install-info
923 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
924 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
925 mv -f dir.info.new dir.info ; \
930 @echo "Building a full distribution of this tree isn't done"
931 @echo "via 'make dist'. Check out the etc/ subdirectory"
940 @for i in $(SUBDIRS); \
944 wd=`basename $$pwd`; \
945 for j in `$(MAKE) ls`; \
951 # with the gnu make, this is done automatically.
953 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
954 $(SHELL) ./config.status
957 # Support for building net releases
959 # Files in devo used in any net release.
960 # ChangeLog omitted because it may refer to files which are not in this
961 # distribution (perhaps it would be better to include it anyway).
962 DEVO_SUPPORT= README Makefile.in configure configure.in \
963 config.guess config.sub config move-if-change \
964 COPYING COPYING.LIB install.sh
966 # Files in devo/etc used in any net release.
967 # ChangeLog omitted because it may refer to files which are not in this
968 # distribution (perhaps it would be better to include it anyway).
969 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
970 configure.texi standards.texi make-stds.texi
972 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
973 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
975 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
977 $(start-sanitize-Sanitize)
978 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
979 $(end-sanitize-Sanitize)
983 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
985 gdb.tar.gz: setup-dirs-gdb
986 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
987 (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
988 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
990 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
991 rm -rf proto-toplev; mkdir proto-toplev
992 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
993 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
996 mkdir proto-toplev/etc
997 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
998 ln -s ../../etc/$$i . ; \
1000 # Put only one copy (four hard links) of COPYING in the tar file.
1001 rm proto-toplev/bfd/COPYING
1002 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1003 rm proto-toplev/include/COPYING
1004 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1005 rm proto-toplev/readline/COPYING
1006 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1008 # Change the bug reporting address in configure to bug-gdb
1009 rm proto-toplev/configure
1011 <configure >proto-toplev/configure
1012 chmod a+x proto-toplev/configure
1014 # Take out texinfo and glob from configurable dirs
1015 rm proto-toplev/configure.in
1016 sed -e '/^host_tools=/s/texinfo //' \
1017 -e '/^host_libs=/s/glob //' \
1018 <configure.in >proto-toplev/configure.in
1020 # Take out texinfo from a few places; make simple BISON=bison line.
1021 rm proto-toplev/Makefile.in
1022 sed -e '/^all\.normal: /s/\all-texinfo //' \
1023 -e '/^ install-texinfo /d' \
1024 -e '/^BISON = /,/^$$/d' \
1025 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1026 <Makefile.in >proto-toplev/Makefile.in
1028 mkdir proto-toplev/texinfo
1029 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1030 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1031 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1032 chmod og=u `find proto-toplev -print`
1033 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1034 echo "==> Making gdb-$$VER.tar.gz"; \
1035 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1036 tar cfh - gdb-$$VER \
1037 | $(GZIPPROG) -v -9 >gdb-$$VER.tar.gz)
1039 # Make the testsuite archive separately.
1040 ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1041 # Blow away the Chill test that requires a Chill compiled executable,
1042 # since GNU Chill is not yet publically available.
1043 rm -rf proto-toplev/gdb/testsuite/gdb.t31
1045 # Put a copy of COPYING in the tar file.
1046 ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1047 chmod og=u `find proto-toplev/gdb/testsuite -print`
1048 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1049 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1050 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1051 gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1052 gdb-$$VER/gdb/testsuite \
1053 | $(GZIPPROG) -v -9 >gdb-$$VER-testsuite.tar.gz)
1055 # When you use `make setup-dirs' or `make taz' you should always redefine
1057 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1058 # Directories that might want `make diststuff' run.
1059 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats
1060 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1061 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1062 # Directories where "info" should be built.
1063 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr
1067 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1068 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1069 # Make sure "diststuff" files get built properly.
1070 for f in $(DISTBISONFILES) ; do \
1071 if [ -r $$f ]; then \
1072 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1076 # Take out texinfo from a few places; make simple BISON=bison line.
1077 sed -e '/^all\.normal: /s/\all-texinfo //' \
1078 -e '/^ install-texinfo /d' \
1079 -e '/^BISON = /,/^$$/d' \
1080 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1082 mv -f tmp Makefile.in
1085 # Doc files don't change; include them in distribution.
1086 for f in $(DISTDOCDIRS) ; do \
1087 if [ -r $$f/Makefile ]; then \
1088 (cd $$f ; $(MAKE) info) || exit 1 ; \
1091 # Make links, and run "make diststuff" when needed.
1092 # The `echo' for setting `p' is to convert all whitespace to spaces.
1093 # Then the `case' further below should tell whether $$d is in
1095 rm -rf proto-toplev ; mkdir proto-toplev
1096 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1097 p=" `echo $(DISTSTUFFDIRS)` " ; \
1098 for d in $$dirs ; do \
1099 if [ -d $$d ]; then \
1102 echo making diststuff in $$d ; \
1103 (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1 ;; \
1105 if [ -d $$d/proto-$$d.dir ]; then \
1106 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1108 ln -s ../$$d proto-toplev/$$d ; \
1110 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1114 mkdir proto-toplev/etc
1115 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1116 ln -s ../../etc/$$i . ; \
1119 # Take out texinfo and glob from configurable dirs
1120 rm proto-toplev/configure.in
1121 sed -e '/^host_tools=/s/texinfo //' \
1122 -e '/^host_libs=/s/glob //' \
1123 <configure.in >proto-toplev/configure.in
1125 mkdir proto-toplev/texinfo
1126 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1127 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1128 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1129 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1130 chmod og=u `find . -print`
1131 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1132 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1133 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1134 tar cfh - $(TOOL)-$$VER \
1135 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1137 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1138 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1141 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1142 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1143 $(MAKE) -f Makefile.in taz TOOL=gas \
1144 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1146 # The FSF "binutils" release includes gprof and ld.
1147 .PHONY: binutils.tar.gz
1148 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1149 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1150 $(MAKE) -f Makefile.in taz TOOL=binutils \
1151 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1153 .PHONY: gas+binutils.tar.gz
1154 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1155 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1156 $(MAKE) -f Makefile.in taz TOOL=gas \
1157 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1159 .PHONY: libg++.tar.gz
1160 LIBGXX_SUPPORT_DIRS=include libio libiberty xiberty
1161 libg++.tar.gz: $(DIST_SUPPORT) libg++
1162 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1163 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1165 GNATS_SUPPORT_DIRS=include libiberty send-pr
1166 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1167 $(MAKE) -f Makefile.in taz TOOL=gnats \
1168 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1173 # start-sanitize-chill
1174 ## This is ugly, but I don't want GNU make to put these variables in
1175 ## the environment. Older makes will see this as a set of targets
1176 ## with no dependencies and no actions.
1177 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1178 # end-sanitize-chill
1180 # end of Makefile.in