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_LAST_FAKE = install_last_fake
54 INSTALL_LAST_REAL = install_last_real
55 INSTALL_LAST = $(INSTALL_LAST_FAKE)
62 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
63 # here so that they can be overridden by Makefile fragments.
64 HOST_CC = $(CC_FOR_BUILD)
66 HOST_PREFIX_1 = loser-
68 # We don't specify -g -O because many compilers don't support -g -O,
69 # and/or -O is broken in and of itself.
72 # start-sanitize-chill
73 CHILLFLAGS = $(CFLAGS)
78 # Use -O to stress test the compiler.
79 CXXFLAGS = -g -O -fexternal-templates
83 # Not plain GZIP, since gzip looks there for extra command-line options.
86 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
87 BISON = `if [ -f $$r/byacc/byacc ] ; \
88 then echo $$r/byacc/byacc ; \
92 LEX = `if [ -f $$r/flex/flex ] ; \
93 then echo $$r/flex/flex ; \
96 M4 = `if [ -f $$r/m4/m4 ] ; \
97 then echo $$r/m4/m4 ; \
100 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
101 then echo $$r/texinfo/makeinfo/makeinfo ; \
102 else echo makeinfo ; fi`
104 # This just becomes part of the MAKEINFO definition passed down to
105 # sub-makes. It lets flags be given on the command line while still
106 # using the makeinfo from the object tree.
109 EXPECT = `if [ -f $$r/expect/expect ] ; \
110 then echo $$r/expect/expect ; \
111 else echo expect ; fi`
113 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
114 then echo $${srcroot}/dejagnu/runtest ; \
115 else echo runtest ; fi`
118 # libraries that may need to be augmented on a system-by-system basis
121 # compilers to use to create programs which must be run in the build
124 CXX_FOR_BUILD = $(CXX)
126 SUBDIRS = "this is set via configure, don't edit this"
130 INSTALL_TARGET = install-dirs \
132 $(INSTALL_TARGET_MODULES) \
133 $(INSTALL_X11_MODULES) \
139 if [ -f $$r/gcc/Makefile ] ; then \
140 if [ -f $$r/newlib/Makefile ] ; then \
141 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
143 echo $$r/gcc/xgcc -B$$r/gcc/; \
146 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
149 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
153 # start-sanitize-chill
154 CHILL_FOR_TARGET = ` \
155 if [ -f $$r/gcc/Makefile ] ; then \
156 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
158 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
161 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
168 if [ -f $$r/gcc/Makefile ] ; then \
169 if [ -f $$r/newlib/Makefile ] ; then \
170 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
172 echo $$r/gcc/xgcc -B$$r/gcc/; \
175 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
178 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
183 if [ -f $$r/gas/Makefile ] ; then \
184 echo $$r/gas/as.new ; \
186 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
189 t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
194 if [ -f $$r/binutils/ar ] ; then \
195 echo $$r/binutils/ar ; \
197 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
200 t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
204 RANLIB_FOR_TARGET = ` \
205 if [ -f $$r/binutils/ranlib ] ; then \
206 echo $$r/binutils/ranlib ; \
208 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
211 t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
216 if [ -f $$r/binutils/Makefile ] ; then \
217 echo $$r/binutils/nm.new ; \
219 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
222 t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
227 #### host and target specific makefile fragments come in here.
230 # Flags to pass down to all sub-makes.
231 # Please keep these in alphabetical order.
232 BASE_FLAGS_TO_PASS = \
233 "AR_FLAGS=$(AR_FLAGS)" \
234 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
235 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
237 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
238 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
240 $(start-sanitize-chill)\
241 "CHILLFLAGS=$(CHILLFLAGS)" \
242 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
243 "CHILL_LIB=$(CHILL_LIB)" \
244 $(end-sanitize-chill)\
245 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
246 "CXXFLAGS=$(CXXFLAGS)" \
247 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
248 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
249 "INSTALL=$(INSTALL)" \
250 "INSTALL_DATA=$(INSTALL_DATA)" \
251 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
252 "INSTALL_XFORM=$(INSTALL_XFORM)" \
253 "LDFLAGS=$(LDFLAGS)" \
256 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
257 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
258 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
261 "RUNTEST=$(RUNTEST)" \
262 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
264 "exec_prefix=$(exec_prefix)" \
268 # Flags to pass down to most sub-makes, in which we're building with
269 # the host environment.
270 # If any variables are added here, they must be added to do-*, below.
279 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
281 # Flags that are concerned with the location of the X11 include files
283 X11_FLAGS_TO_PASS = \
284 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
285 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
288 # Flags to pass down to makes which are built with the target environment.
289 # The double $ decreases the length of the command line; the variables
290 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
291 # If any variables are added here, they must be added to do-*, below.
292 EXTRA_TARGET_FLAGS = \
293 'AR=$$(AR_FOR_TARGET)' \
294 'AS=$$(AS_FOR_TARGET)' \
295 'CC=$$(CC_FOR_TARGET)' \
296 'CXX=$$(CXX_FOR_TARGET)' \
297 'NM=$$(NM_FOR_TARGET)' \
298 'RANLIB=$$(RANLIB_FOR_TARGET)'
300 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
302 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
303 # unfortunately needs the native compiler and the target ar and
305 # If any variables are added here, they must be added to do-*, below.
306 # The HOST_* variables are a special case, which are used for the gcc
307 # cross-building scheme.
309 'AR=$$(AR_FOR_TARGET)' \
313 'HOST_CC=$(CC_FOR_BUILD)' \
314 'HOST_PREFIX=$(HOST_PREFIX)' \
315 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
317 '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).
372 # This is a list of the check targets for all of the modules which are
373 # compiled using $(FLAGS_TO_PASS).
420 # This is a list of the install targets for all of the modules which are
421 # compiled using $(FLAGS_TO_PASS).
470 # This is a list of the targets for all of the modules which are compiled
471 # using $(X11_FLAGS_TO_PASS).
479 # This is a list of the check targets for all of the modules which are
480 # compiled using $(X11_FLAGS_TO_PASS).
481 CHECK_X11_MODULES = \
488 # This is a list of the install targets for all the modules which are
489 # compiled using $(X11_FLAGS_TO_PASS).
490 INSTALL_X11_MODULES = \
497 # This is a list of the targets for all of the modules which are compiled
498 # using $(TARGET_FLAGS_TO_PASS).
499 ALL_TARGET_MODULES = \
500 $(start-sanitize-chill) \
502 $(end-sanitize-chill) \
508 # This is a list of the check targets for all of the modules which are
509 # compiled using $(TARGET_FLAGS_TO_PASS).
510 CHECK_TARGET_MODULES = \
511 $(start-sanitize-chill) \
513 $(end-sanitize-chill) \
519 # This is a list of the install targets for all of the modules which are
520 # compiled using $(TARGET_FLAGS_TO_PASS).
521 INSTALL_TARGET_MODULES = \
522 $(start-sanitize-chill) \
524 $(end-sanitize-chill) \
530 # This is a shell case of all modules which are compiled using
531 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
532 TARGET_LIBS = libio | libg++ | newlib | xiberty
533 # start-sanitize-chill
534 TARGET_LIBS = chillrt | libio | libg++ | newlib | xiberty
537 # The first rule in the file had better be this one. Don't put any above it.
541 # The target built for a native build.
545 $(ALL_TARGET_MODULES) \
549 # Do a target for all the subdirectories. A ``make do-X'' will do a
550 # ``make X'' in all subdirectories (because, in general, there is a
551 # dependency (below) of X upon do-X, a ``make X'' will also do this,
552 # but it may do additional work as well).
553 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
554 # because it is so large that it can easily overflow the command line
555 # length limit on some systems.
568 @target=`echo $@ | sed -e 's/^do-//'`; \
570 srcroot=`cd $(srcdir); pwd`; export srcroot; \
571 for i in $(SUBDIRS); do \
572 if [ -f ./$$i/Makefile ]; then \
575 for flag in $(EXTRA_TARGET_FLAGS); do \
576 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
580 for flag in $(EXTRA_GCC_FLAGS); do \
581 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
585 for flag in $(EXTRA_HOST_FLAGS); do \
586 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
590 export AR AS CC CXX NM RANLIB; \
592 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
593 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
594 "RANLIB=$${RANLIB}" \
596 then true; else exit 1; fi; \
600 # Here are the targets which correspond to the do-X targets.
602 .PHONY: info installcheck dvi install-info
603 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
605 installcheck: do-installcheck
608 install-info: do-install-info dir.info
609 srcroot=`cd $(srcdir); pwd`; export srcroot; \
610 if [ -f dir.info ] ; then \
611 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
615 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
618 -rm -f Makefile config.status
620 clean: do-clean local-clean
621 mostlyclean: do-mostlyclean local-clean
622 distclean: do-distclean local-clean local-distclean
623 realclean: do-realclean local-clean local-distclean
628 check: $(CHECK_MODULES) \
629 $(CHECK_TARGET_MODULES) \
630 $(CHECK_X11_MODULES) \
633 # Installation targets.
635 .PHONY: install uninstall vault-install
636 install: $(INSTALL_TARGET)
639 @echo "the uninstall target is not supported in this tree"
642 @if [ -f ./release/vault-install ] ; then \
643 ./release/vault-install $(host_alias) $(target_alias) ; \
649 install.all: install-no-fixedincludes
650 @if [ -f ./gcc/Makefile ] ; then \
651 r=`pwd` ; export r ; \
653 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
658 # install-no-fixedincludes is used because Cygnus can not distribute
659 # the fixed header files.
660 .PHONY: install-no-fixedincludes
661 install-no-fixedincludes: \
664 $(INSTALL_TARGET_MODULES) \
665 $(INSTALL_X11_MODULES) \
668 # Install the gcc headers files, but not the fixed include files,
669 # which Cygnus is not allowed to distribute. This rule is very
670 # dependent on the workings of the gcc Makefile.in.
671 .PHONY: gcc-no-fixedincludes
672 gcc-no-fixedincludes:
673 @if [ -f ./gcc/Makefile ]; then \
674 rm -rf gcc/tmp-include; \
675 mv gcc/include gcc/tmp-include 2>/dev/null; \
677 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
678 touch gcc/stmp-fixinc gcc/include/fixed; \
679 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
681 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
683 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
684 rm -rf gcc/include; \
685 mv gcc/tmp-include gcc/include 2>/dev/null; \
688 # This rule is used to build the modules which use FLAGS_TO_PASS. To
689 # build a target all-X means to cd to X and make all.
690 # all-glob is handled specially because it doesn't actually build.
691 .PHONY: $(ALL_MODULES) all-glob
692 $(ALL_MODULES) all-glob:
693 @dir=`echo $@ | sed -e 's/all-//'`; \
694 if [ -f ./$${dir}/Makefile ] ; then \
696 srcroot=`cd $(srcdir); pwd`; export srcroot; \
697 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
702 # This rule is used to check the modules which use FLAGS_TO_PASS. To
703 # build a target check-X means to cd to X and make all.
704 .PHONY: $(CHECK_MODULES)
706 @dir=`echo $@ | sed -e 's/check-//'`; \
707 if [ -f ./$${dir}/Makefile ] ; then \
709 srcroot=`cd $(srcdir); pwd`; export srcroot; \
710 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
715 # This rule is used to install the modules which use FLAGS_TO_PASS.
716 # To build a target install-X means to cd to X and make install.
717 .PHONY: $(INSTALL_MODULES)
718 $(INSTALL_MODULES): install-dirs
719 @dir=`echo $@ | sed -e 's/install-//'`; \
720 if [ -f ./$${dir}/Makefile ] ; then \
722 srcroot=`cd $(srcdir); pwd`; export srcroot; \
723 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
728 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
729 # To build a target all-X means to cd to X and make all.
730 .PHONY: $(ALL_TARGET_MODULES)
731 $(ALL_TARGET_MODULES):
732 @dir=`echo $@ | sed -e 's/all-//'`; \
733 if [ -f ./$${dir}/Makefile ] ; then \
735 srcroot=`cd $(srcdir); pwd`; export srcroot; \
736 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
741 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
742 # To build a target install-X means to cd to X and make install.
743 .PHONY: $(CHECK_TARGET_MODULES)
744 $(CHECK_TARGET_MODULES):
745 @dir=`echo $@ | sed -e 's/check-//'`; \
746 if [ -f ./$${dir}/Makefile ] ; then \
748 srcroot=`cd $(srcdir); pwd`; export srcroot; \
749 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
754 # This rule is used to install the modules which use
755 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
757 .PHONY: $(INSTALL_TARGET_MODULES)
758 $(INSTALL_TARGET_MODULES): install-dirs
759 @dir=`echo $@ | sed -e 's/install-//'`; \
760 if [ -f ./$${dir}/Makefile ] ; then \
762 srcroot=`cd $(srcdir); pwd`; export srcroot; \
763 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
768 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
769 # To build a target all-X means to cd to X and make all.
770 .PHONY: $(ALL_X11_MODULES)
772 @dir=`echo $@ | sed -e 's/all-//'`; \
773 if [ -f ./$${dir}/Makefile ] ; then \
775 srcroot=`cd $(srcdir); pwd`; export srcroot; \
777 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
782 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
783 # To build a target check-X means to cd to X and make all.
784 .PHONY: $(CHECK_X11_MODULES)
785 $(CHECK_X11_MODULES):
786 @dir=`echo $@ | sed -e 's/check-//'`; \
787 if [ -f ./$${dir}/Makefile ] ; then \
789 srcroot=`cd $(srcdir); pwd`; export srcroot; \
791 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
796 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
797 # To build a target install-X means to cd to X and make install.
798 .PHONY: $(INSTALL_X11_MODULES)
799 $(INSTALL_X11_MODULES):
800 @dir=`echo $@ | sed -e 's/install-//'`; \
801 if [ -f ./$${dir}/Makefile ] ; then \
803 srcroot=`cd $(srcdir); pwd`; export srcroot; \
805 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
810 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
813 @if [ -f ./gcc/Makefile ] ; then \
815 srcroot=`cd $(srcdir); pwd`; export srcroot; \
816 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
823 @if [ -f ./gcc/Makefile ] ; then \
825 srcroot=`cd $(srcdir); pwd`; export srcroot; \
826 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
833 @if [ -f ./gcc/Makefile ] ; then \
835 srcroot=`cd $(srcdir); pwd`; export srcroot; \
836 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
843 # This rule is used to install the modules which use FLAGS_TO_PASS.
844 # To build a target install-X means to cd to X and make install.
845 .PHONY: $(INSTALL_LAST_REAL)
846 $(INSTALL_LAST_REAL): install-dirs
847 @dir=`echo $@ | sed -e 's/install-//'`; \
848 if [ -f ./$${dir}/Makefile ] ; then \
850 srcroot=`cd $(srcdir); pwd`; export srcroot; \
851 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
859 # This is a list of inter-dependencies among modules.
862 all-binutils: all-libiberty all-opcodes all-bfd all-flex
864 # start-sanitize-chill
865 all-chillrt: all-binutils all-gas all-gcc all-newlib
869 all-diff: all-libiberty
872 all-expect: all-tcl all-tk
873 all-fileutils: all-libiberty
875 all-flex: all-libiberty all-byacc
876 all-gas: all-libiberty all-opcodes all-bfd
879 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
880 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
882 all-gprof: all-libiberty all-bfd
883 all-grep: all-libiberty
884 all-gzip: all-libiberty
885 all-hello: all-libiberty
887 all-ispell: all-emacs
888 all-ld: all-libiberty all-bfd all-byacc all-flex
889 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
890 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
892 all-m4: all-libiberty
893 all-make: all-libiberty
895 all-newlib: all-binutils all-gas all-pagas all-gcc
898 all-prms: all-libiberty
901 all-recode: all-libiberty
902 all-sed: all-libiberty
903 all-send-pr: all-prms
905 all-sim: all-libiberty all-bfd
906 all-tar: all-libiberty
908 all-tclX: all-tcl all-tk
910 all-texinfo: all-libiberty
912 all-tgas: all-libiberty all-bfd
915 all-uudecode: all-libiberty
916 all-xiberty: all-gcc all-newlib
918 ### other supporting targets
927 @for i in $(MAKEDIRS) ; do \
928 echo Making $$i... ; \
929 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
930 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
931 if [ ! -d $$i ] ; then \
932 if mkdir $$i ; then \
943 dir.info: do-install-info
944 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
945 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
946 mv -f dir.info.new dir.info ; \
951 @echo "Building a full distribution of this tree isn't done"
952 @echo "via 'make dist'. Check out the etc/ subdirectory"
956 # Right now this just builds TAGS in each subdirectory. emacs19 has the
957 # ability to use several tags files at once, so there is probably no need
958 # to combine them into one big TAGS file (like CVS 1.3 does). We could
959 # (if we felt like it) have this Makefile write a piece of elisp which
960 # the user could load to tell emacs19 where all the TAGS files we just
964 # with the gnu make, this is done automatically.
966 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
967 $(SHELL) ./config.status
970 # Support for building net releases
972 # Files in devo used in any net release.
973 # ChangeLog omitted because it may refer to files which are not in this
974 # distribution (perhaps it would be better to include it anyway).
975 DEVO_SUPPORT= README Makefile.in configure configure.in \
976 config.guess config.sub config move-if-change \
977 COPYING COPYING.LIB install.sh
979 # Files in devo/etc used in any net release.
980 # ChangeLog omitted because it may refer to files which are not in this
981 # distribution (perhaps it would be better to include it anyway).
982 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
983 configure.texi standards.texi make-stds.texi
985 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
986 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
988 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
990 $(start-sanitize-Sanitize)
991 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
992 $(end-sanitize-Sanitize)
996 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
998 gdb.tar.gz: setup-dirs-gdb
999 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
1000 (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
1001 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
1003 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
1004 rm -rf proto-toplev; mkdir proto-toplev
1005 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1006 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1009 mkdir proto-toplev/etc
1010 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1011 ln -s ../../etc/$$i . ; \
1013 # Put only one copy (four hard links) of COPYING in the tar file.
1014 rm proto-toplev/bfd/COPYING
1015 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1016 rm proto-toplev/include/COPYING
1017 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1018 rm proto-toplev/readline/COPYING
1019 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1021 # Change the bug reporting address in configure to bug-gdb
1022 rm proto-toplev/configure
1023 sed -e 's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
1024 <configure >proto-toplev/configure
1025 chmod a+x proto-toplev/configure
1027 # Take out texinfo and glob from configurable dirs
1028 rm proto-toplev/configure.in
1029 sed -e '/^host_tools=/s/texinfo //' \
1030 -e '/^host_libs=/s/glob //' \
1031 <configure.in >proto-toplev/configure.in
1033 # Take out texinfo from a few places; make simple BISON=bison line.
1034 rm proto-toplev/Makefile.in
1035 sed -e '/^all\.normal: /s/\all-texinfo //' \
1036 -e '/^ install-texinfo /d' \
1037 -e '/^BISON = /,/^$$/d' \
1038 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1039 <Makefile.in >proto-toplev/Makefile.in
1041 mkdir proto-toplev/texinfo
1042 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1043 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1044 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1045 chmod og=u `find proto-toplev -print`
1046 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1047 echo "==> Making gdb-$$VER.tar.gz"; \
1048 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1049 tar cfh - gdb-$$VER \
1050 | $(GZIPPROG) -v -9 >gdb-$$VER.tar.gz)
1052 # Make the testsuite archive separately.
1053 ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1054 # Blow away the Chill test that requires a Chill compiled executable,
1055 # since GNU Chill is not yet publically available.
1056 rm -rf proto-toplev/gdb/testsuite/gdb.t31
1058 # Put a copy of COPYING in the tar file.
1059 ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1060 chmod og=u `find proto-toplev/gdb/testsuite -print`
1061 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1062 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1063 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1064 gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1065 gdb-$$VER/gdb/testsuite \
1066 | $(GZIPPROG) -v -9 >gdb-$$VER-testsuite.tar.gz)
1068 # When you use `make setup-dirs' or `make taz' you should always redefine
1070 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1071 # Directories that might want `make diststuff' run.
1072 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats
1073 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1074 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1075 # Directories where "info" should be built.
1076 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr
1080 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1081 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1082 # Make sure "diststuff" files get built properly.
1083 for f in $(DISTBISONFILES) ; do \
1084 if [ -r $$f ]; then \
1085 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1089 # Take out texinfo from a few places; make simple BISON=bison line.
1090 sed -e '/^all\.normal: /s/\all-texinfo //' \
1091 -e '/^ install-texinfo /d' \
1092 -e '/^BISON = /,/^$$/d' \
1093 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1095 mv -f tmp Makefile.in
1098 # Doc files don't change; include them in distribution.
1099 for f in $(DISTDOCDIRS) ; do \
1100 if [ -r $$f/Makefile ]; then \
1101 (cd $$f ; $(MAKE) info) || exit 1 ; \
1104 # Make links, and run "make diststuff" when needed.
1105 # The `echo' for setting `p' is to convert all whitespace to spaces.
1106 # Then the `case' further below should tell whether $$d is in
1108 rm -rf proto-toplev ; mkdir proto-toplev
1109 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1110 p=" `echo $(DISTSTUFFDIRS)` " ; \
1111 for d in $$dirs ; do \
1112 if [ -d $$d ]; then \
1115 echo making diststuff in $$d ; \
1116 (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1 ;; \
1118 if [ -d $$d/proto-$$d.dir ]; then \
1119 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1121 ln -s ../$$d proto-toplev/$$d ; \
1123 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1127 mkdir proto-toplev/etc
1128 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1129 ln -s ../../etc/$$i . ; \
1132 # Take out texinfo and glob from configurable dirs
1133 rm proto-toplev/configure.in
1134 sed -e '/^host_tools=/s/texinfo //' \
1135 -e '/^host_libs=/s/glob //' \
1136 <configure.in >proto-toplev/configure.in
1138 mkdir proto-toplev/texinfo
1139 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1140 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1141 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1142 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1143 chmod og=u `find . -print`
1144 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1145 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1146 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1147 tar cfh - $(TOOL)-$$VER \
1148 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1150 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1151 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1154 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1155 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1156 $(MAKE) -f Makefile.in taz TOOL=gas \
1157 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1159 # The FSF "binutils" release includes gprof and ld.
1160 .PHONY: binutils.tar.gz
1161 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1162 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1163 $(MAKE) -f Makefile.in taz TOOL=binutils \
1164 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1166 .PHONY: gas+binutils.tar.gz
1167 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1168 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1169 $(MAKE) -f Makefile.in taz TOOL=gas \
1170 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1172 .PHONY: libg++.tar.gz
1173 LIBGXX_SUPPORT_DIRS=include libio libiberty xiberty
1174 libg++.tar.gz: $(DIST_SUPPORT) libg++
1175 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1176 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1178 GNATS_SUPPORT_DIRS=include libiberty send-pr
1179 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1180 $(MAKE) -f Makefile.in taz TOOL=gnats \
1181 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1186 # start-sanitize-chill
1187 ## This is ugly, but I don't want GNU make to put these variables in
1188 ## the environment. Older makes will see this as a set of targets
1189 ## with no dependencies and no actions.
1190 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1191 # end-sanitize-chill
1193 # end of Makefile.in