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 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
59 # here so that they can be overridden by Makefile fragments.
60 HOST_CC = $(CC_FOR_BUILD)
62 HOST_PREFIX_1 = loser-
64 # We don't specify -g -O because many compilers don't support -g -O,
65 # and/or -O is broken in and of itself.
68 # start-sanitize-chill
69 CHILLFLAGS = $(CFLAGS)
74 # Use -O to stress test the compiler.
75 CXXFLAGS = -g -O -fexternal-templates
79 # Not plain GZIP, since gzip looks there for extra command-line options.
82 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
83 BISON = `if [ -f $$r/byacc/byacc ] ; \
84 then echo $$r/byacc/byacc ; \
88 LEX = `if [ -f $$r/flex/flex ] ; \
89 then echo $$r/flex/flex ; \
92 M4 = `if [ -f $$r/m4/m4 ] ; \
93 then echo $$r/m4/m4 ; \
96 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
97 then echo $$r/texinfo/makeinfo/makeinfo ; \
98 else echo makeinfo ; fi`
100 # This just becomes part of the MAKEINFO definition passed down to
101 # sub-makes. It lets flags be given on the command line while still
102 # using the makeinfo from the object tree.
105 EXPECT = `if [ -f $$r/expect/expect ] ; \
106 then echo $$r/expect/expect ; \
107 else echo expect ; fi`
109 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
110 then echo $${srcroot}/dejagnu/runtest ; \
111 else echo runtest ; fi`
114 # libraries that may need to be augmented on a system-by-system basis
117 # compilers to use to create programs which must be run in the build
120 CXX_FOR_BUILD = $(CXX)
122 SUBDIRS = "this is set via configure, don't edit this"
126 INSTALL_TARGET = install-dirs \
128 $(INSTALL_TARGET_MODULES) \
129 $(INSTALL_X11_MODULES) \
135 if [ -f $$r/gcc/Makefile ] ; then \
136 if [ -f $$r/newlib/Makefile ] ; then \
137 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
139 echo $$r/gcc/xgcc -B$$r/gcc/; \
142 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
145 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
149 # start-sanitize-chill
150 CHILL_FOR_TARGET = ` \
151 if [ -f $$r/gcc/Makefile ] ; then \
152 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
154 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
157 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
164 if [ -f $$r/gcc/Makefile ] ; then \
165 if [ -f $$r/newlib/Makefile ] ; then \
166 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
168 echo $$r/gcc/xgcc -B$$r/gcc/; \
171 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
174 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
179 if [ -f $$r/gas/Makefile ] ; then \
180 echo $$r/gas/as.new ; \
182 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
185 t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
190 if [ -f $$r/binutils/ar ] ; then \
191 echo $$r/binutils/ar ; \
193 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
196 t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
200 RANLIB_FOR_TARGET = ` \
201 if [ -f $$r/binutils/ranlib ] ; then \
202 echo $$r/binutils/ranlib ; \
204 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
207 t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
212 if [ -f $$r/binutils/Makefile ] ; then \
213 echo $$r/binutils/nm.new ; \
215 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
218 t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
222 #### host and target specific makefile fragments come in here.
225 # Flags to pass down to all sub-makes.
226 # Please keep these in alphabetical order.
227 BASE_FLAGS_TO_PASS = \
228 "AR_FLAGS=$(AR_FLAGS)" \
229 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
230 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
232 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
233 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
235 $(start-sanitize-chill)\
236 "CHILLFLAGS=$(CHILLFLAGS)" \
237 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
238 "CHILL_LIB=$(CHILL_LIB)" \
239 $(end-sanitize-chill)\
240 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
241 "CXXFLAGS=$(CXXFLAGS)" \
242 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
243 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
244 "INSTALL=$(INSTALL)" \
245 "INSTALL_DATA=$(INSTALL_DATA)" \
246 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
247 "INSTALL_XFORM=$(INSTALL_XFORM)" \
248 "LDFLAGS=$(LDFLAGS)" \
251 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
252 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
253 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
256 "RUNTEST=$(RUNTEST)" \
257 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
259 "exec_prefix=$(exec_prefix)" \
263 # Flags to pass down to most sub-makes, in which we're building with
264 # the host environment.
265 # 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)'
295 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
297 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
298 # unfortunately needs the native compiler and the target ar and
300 # If any variables are added here, they must be added to do-*, below.
301 # The HOST_* variables are a special case, which are used for the gcc
302 # cross-building scheme.
304 'AR=$$(AR_FOR_TARGET)' \
308 'HOST_CC=$(CC_FOR_BUILD)' \
309 'HOST_PREFIX=$(HOST_PREFIX)' \
310 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
312 'RANLIB=$$(RANLIB_FOR_TARGET)'
314 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
316 # This is a list of the targets for all of the modules which are compiled
317 # using $(FLAGS_TO_PASS).
367 # This is a list of the check targets for all of the modules which are
368 # compiled using $(FLAGS_TO_PASS).
415 # This is a list of the install targets for all of the modules which are
416 # compiled using $(FLAGS_TO_PASS).
465 # This is a list of the targets for all of the modules which are compiled
466 # using $(X11_FLAGS_TO_PASS).
474 # This is a list of the check targets for all of the modules which are
475 # compiled using $(X11_FLAGS_TO_PASS).
476 CHECK_X11_MODULES = \
483 # This is a list of the install targets for all the modules which are
484 # compiled using $(X11_FLAGS_TO_PASS).
485 INSTALL_X11_MODULES = \
492 # This is a list of the targets for all of the modules which are compiled
493 # using $(TARGET_FLAGS_TO_PASS).
494 ALL_TARGET_MODULES = \
495 $(start-sanitize-chill) \
497 $(end-sanitize-chill) \
503 # This is a list of the check targets for all of the modules which are
504 # compiled using $(TARGET_FLAGS_TO_PASS).
505 CHECK_TARGET_MODULES = \
506 $(start-sanitize-chill) \
508 $(end-sanitize-chill) \
514 # This is a list of the install targets for all of the modules which are
515 # compiled using $(TARGET_FLAGS_TO_PASS).
516 INSTALL_TARGET_MODULES = \
517 $(start-sanitize-chill) \
519 $(end-sanitize-chill) \
525 # This is a shell case of all modules which are compiled using
526 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
527 TARGET_LIBS = libio | libg++ | newlib | xiberty
528 # start-sanitize-chill
529 TARGET_LIBS = chillrt | libio | libg++ | newlib | xiberty
532 # The first rule in the file had better be this one. Don't put any above it.
536 # The target built for a native build.
540 $(ALL_TARGET_MODULES) \
544 # Do a target for all the subdirectories. A ``make do-X'' will do a
545 # ``make X'' in all subdirectories (because, in general, there is a
546 # dependency (below) of X upon do-X, a ``make X'' will also do this,
547 # but it may do additional work as well).
548 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
549 # because it is so large that it can easily overflow the command line
550 # length limit on some systems.
563 @target=`echo $@ | sed -e 's/^do-//'`; \
565 srcroot=`cd $(srcdir); pwd`; export srcroot; \
566 for i in $(SUBDIRS); do \
567 if [ -f ./$$i/Makefile ]; then \
570 for flag in $(EXTRA_TARGET_FLAGS); do \
571 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
575 for flag in $(EXTRA_GCC_FLAGS); do \
576 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
580 for flag in $(EXTRA_HOST_FLAGS); do \
581 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
585 export AR AS CC CXX NM RANLIB; \
587 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
588 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
589 "RANLIB=$${RANLIB}" \
591 then true; else exit 1; fi; \
595 # Here are the targets which correspond to the do-X targets.
597 .PHONY: info installcheck dvi install-info
598 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
600 installcheck: do-installcheck
603 install-info: do-install-info dir.info
604 srcroot=`cd $(srcdir); pwd`; export srcroot; \
605 if [ -f dir.info ] ; then \
606 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
610 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
613 -rm -f Makefile config.status
615 clean: do-clean local-clean
616 mostlyclean: do-mostlyclean local-clean
617 distclean: do-distclean local-clean local-distclean
618 realclean: do-realclean local-clean local-distclean
623 check: $(CHECK_MODULES) \
624 $(CHECK_TARGET_MODULES) \
625 $(CHECK_X11_MODULES) \
628 # Installation targets.
630 .PHONY: install uninstall vault-install
631 install: $(INSTALL_TARGET)
634 @echo "the uninstall target is not supported in this tree"
637 @if [ -f ./release/vault-install ] ; then \
638 ./release/vault-install $(host_alias) $(target_alias) ; \
644 install.all: install-no-fixedincludes
645 @if [ -f ./gcc/Makefile ] ; then \
646 r=`pwd` ; export r ; \
648 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
653 # install-no-fixedincludes is used because Cygnus can not distribute
654 # the fixed header files.
655 .PHONY: install-no-fixedincludes
656 install-no-fixedincludes: \
659 $(INSTALL_TARGET_MODULES) \
660 $(INSTALL_X11_MODULES) \
663 # Install the gcc headers files, but not the fixed include files,
664 # which Cygnus is not allowed to distribute. This rule is very
665 # dependent on the workings of the gcc Makefile.in.
666 .PHONY: gcc-no-fixedincludes
667 gcc-no-fixedincludes:
668 @if [ -f ./gcc/Makefile ]; then \
669 rm -rf gcc/tmp-include; \
670 mv gcc/include gcc/tmp-include 2>/dev/null; \
672 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
673 touch gcc/stmp-fixinc gcc/include/fixed; \
674 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
676 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
678 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
679 rm -rf gcc/include; \
680 mv gcc/tmp-include gcc/include 2>/dev/null; \
683 # This rule is used to build the modules which use FLAGS_TO_PASS. To
684 # build a target all-X means to cd to X and make all.
685 # all-glob is handled specially because it doesn't actually build.
686 .PHONY: $(ALL_MODULES) all-glob
687 $(ALL_MODULES) all-glob:
688 @dir=`echo $@ | sed -e 's/all-//'`; \
689 if [ -f ./$${dir}/Makefile ] ; then \
691 srcroot=`cd $(srcdir); pwd`; export srcroot; \
692 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
697 # This rule is used to check the modules which use FLAGS_TO_PASS. To
698 # build a target check-X means to cd to X and make all.
699 .PHONY: $(CHECK_MODULES)
701 @dir=`echo $@ | sed -e 's/check-//'`; \
702 if [ -f ./$${dir}/Makefile ] ; then \
704 srcroot=`cd $(srcdir); pwd`; export srcroot; \
705 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
710 # This rule is used to install the modules which use FLAGS_TO_PASS.
711 # To build a target install-X means to cd to X and make install.
712 .PHONY: $(INSTALL_MODULES)
713 $(INSTALL_MODULES): install-dirs
714 @dir=`echo $@ | sed -e 's/install-//'`; \
715 if [ -f ./$${dir}/Makefile ] ; then \
717 srcroot=`cd $(srcdir); pwd`; export srcroot; \
718 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
723 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
724 # To build a target all-X means to cd to X and make all.
725 .PHONY: $(ALL_TARGET_MODULES)
726 $(ALL_TARGET_MODULES):
727 @dir=`echo $@ | sed -e 's/all-//'`; \
728 if [ -f ./$${dir}/Makefile ] ; then \
730 srcroot=`cd $(srcdir); pwd`; export srcroot; \
731 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
736 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
737 # To build a target install-X means to cd to X and make install.
738 .PHONY: $(CHECK_TARGET_MODULES)
739 $(CHECK_TARGET_MODULES):
740 @dir=`echo $@ | sed -e 's/check-//'`; \
741 if [ -f ./$${dir}/Makefile ] ; then \
743 srcroot=`cd $(srcdir); pwd`; export srcroot; \
744 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
749 # This rule is used to install the modules which use
750 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
752 .PHONY: $(INSTALL_TARGET_MODULES)
753 $(INSTALL_TARGET_MODULES): install-dirs
754 @dir=`echo $@ | sed -e 's/install-//'`; \
755 if [ -f ./$${dir}/Makefile ] ; then \
757 srcroot=`cd $(srcdir); pwd`; export srcroot; \
758 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
763 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
764 # To build a target all-X means to cd to X and make all.
765 .PHONY: $(ALL_X11_MODULES)
767 @dir=`echo $@ | sed -e 's/all-//'`; \
768 if [ -f ./$${dir}/Makefile ] ; then \
770 srcroot=`cd $(srcdir); pwd`; export srcroot; \
772 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
777 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
778 # To build a target check-X means to cd to X and make all.
779 .PHONY: $(CHECK_X11_MODULES)
780 $(CHECK_X11_MODULES):
781 @dir=`echo $@ | sed -e 's/check-//'`; \
782 if [ -f ./$${dir}/Makefile ] ; then \
784 srcroot=`cd $(srcdir); pwd`; export srcroot; \
786 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
791 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
792 # To build a target install-X means to cd to X and make install.
793 .PHONY: $(INSTALL_X11_MODULES)
794 $(INSTALL_X11_MODULES):
795 @dir=`echo $@ | sed -e 's/install-//'`; \
796 if [ -f ./$${dir}/Makefile ] ; then \
798 srcroot=`cd $(srcdir); pwd`; export srcroot; \
800 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
805 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
808 @if [ -f ./gcc/Makefile ] ; then \
810 srcroot=`cd $(srcdir); pwd`; export srcroot; \
811 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
818 @if [ -f ./gcc/Makefile ] ; then \
820 srcroot=`cd $(srcdir); pwd`; export srcroot; \
821 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
828 @if [ -f ./gcc/Makefile ] ; then \
830 srcroot=`cd $(srcdir); pwd`; export srcroot; \
831 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
838 # This rule is used to install the modules which use FLAGS_TO_PASS.
839 # To build a target install-X means to cd to X and make install.
840 .PHONY: $(INSTALL_LAST)
841 $(INSTALL_LAST): install-dirs
842 @dir=`echo $@ | sed -e 's/install-//'`; \
843 if [ -f ./$${dir}/Makefile ] ; then \
845 srcroot=`cd $(srcdir); pwd`; export srcroot; \
846 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
852 # This is a list of inter-dependencies among modules.
855 all-binutils: all-libiberty all-opcodes all-bfd all-flex
857 # start-sanitize-chill
858 all-chillrt: all-binutils all-gas all-gcc all-newlib
862 all-diff: all-libiberty
865 all-expect: all-tcl all-tk
866 all-fileutils: all-libiberty
868 all-flex: all-libiberty all-byacc
869 all-gas: all-libiberty all-opcodes all-bfd
872 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
873 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
875 all-gprof: all-libiberty all-bfd
876 all-grep: all-libiberty
877 all-gzip: all-libiberty
878 all-hello: all-libiberty
880 all-ispell: all-emacs
881 all-ld: all-libiberty all-bfd all-byacc all-flex
882 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
883 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
885 all-m4: all-libiberty
886 all-make: all-libiberty
888 all-newlib: all-binutils all-gas all-pagas all-gcc
891 all-prms: all-libiberty
894 all-recode: all-libiberty
895 all-sed: all-libiberty
896 all-send-pr: all-prms
898 all-sim: all-libiberty all-bfd
899 all-tar: all-libiberty
901 all-tclX: all-tcl all-tk
903 all-texinfo: all-libiberty
905 all-tgas: all-libiberty all-bfd
908 all-uudecode: all-libiberty
909 all-xiberty: all-gcc all-newlib
911 ### other supporting targets
920 @for i in $(MAKEDIRS) ; do \
921 echo Making $$i... ; \
922 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
923 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
924 if [ ! -d $$i ] ; then \
925 if mkdir $$i ; then \
936 dir.info: do-install-info
937 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
938 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
939 mv -f dir.info.new dir.info ; \
944 @echo "Building a full distribution of this tree isn't done"
945 @echo "via 'make dist'. Check out the etc/ subdirectory"
949 # Right now this just builds TAGS in each subdirectory. emacs19 has the
950 # ability to use several tags files at once, so there is probably no need
951 # to combine them into one big TAGS file (like CVS 1.3 does). We could
952 # (if we felt like it) have this Makefile write a piece of elisp which
953 # the user could load to tell emacs19 where all the TAGS files we just
957 # with the gnu make, this is done automatically.
959 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
960 $(SHELL) ./config.status
963 # Support for building net releases
965 # Files in devo used in any net release.
966 # ChangeLog omitted because it may refer to files which are not in this
967 # distribution (perhaps it would be better to include it anyway).
968 DEVO_SUPPORT= README Makefile.in configure configure.in \
969 config.guess config.sub config move-if-change \
970 COPYING COPYING.LIB install.sh
972 # Files in devo/etc 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 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
976 configure.texi standards.texi make-stds.texi
978 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
979 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
981 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
983 $(start-sanitize-Sanitize)
984 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
985 $(end-sanitize-Sanitize)
989 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
991 gdb.tar.gz: setup-dirs-gdb
992 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
993 (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
994 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
996 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
997 rm -rf proto-toplev; mkdir proto-toplev
998 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
999 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1002 mkdir proto-toplev/etc
1003 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1004 ln -s ../../etc/$$i . ; \
1006 # Put only one copy (four hard links) of COPYING in the tar file.
1007 rm proto-toplev/bfd/COPYING
1008 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1009 rm proto-toplev/include/COPYING
1010 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1011 rm proto-toplev/readline/COPYING
1012 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1014 # Change the bug reporting address in configure to bug-gdb
1015 rm proto-toplev/configure
1016 sed -e 's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
1017 <configure >proto-toplev/configure
1018 chmod a+x proto-toplev/configure
1020 # Take out texinfo and glob from configurable dirs
1021 rm proto-toplev/configure.in
1022 sed -e '/^host_tools=/s/texinfo //' \
1023 -e '/^host_libs=/s/glob //' \
1024 <configure.in >proto-toplev/configure.in
1026 # Take out texinfo from a few places; make simple BISON=bison line.
1027 rm proto-toplev/Makefile.in
1028 sed -e '/^all\.normal: /s/\all-texinfo //' \
1029 -e '/^ install-texinfo /d' \
1030 -e '/^BISON = /,/^$$/d' \
1031 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1032 <Makefile.in >proto-toplev/Makefile.in
1034 mkdir proto-toplev/texinfo
1035 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1036 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1037 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1038 chmod og=u `find proto-toplev -print`
1039 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1040 echo "==> Making gdb-$$VER.tar.gz"; \
1041 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1042 tar cfh - gdb-$$VER \
1043 | $(GZIPPROG) -v -9 >gdb-$$VER.tar.gz)
1045 # Make the testsuite archive separately.
1046 ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1047 # Blow away the Chill test that requires a Chill compiled executable,
1048 # since GNU Chill is not yet publically available.
1049 rm -rf proto-toplev/gdb/testsuite/gdb.t31
1051 # Put a copy of COPYING in the tar file.
1052 ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1053 chmod og=u `find proto-toplev/gdb/testsuite -print`
1054 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1055 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1056 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1057 gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1058 gdb-$$VER/gdb/testsuite \
1059 | $(GZIPPROG) -v -9 >gdb-$$VER-testsuite.tar.gz)
1061 # When you use `make setup-dirs' or `make taz' you should always redefine
1063 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1064 # Directories that might want `make diststuff' run.
1065 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats
1066 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1067 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1068 # Directories where "info" should be built.
1069 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr
1073 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1074 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1075 # Make sure "diststuff" files get built properly.
1076 for f in $(DISTBISONFILES) ; do \
1077 if [ -r $$f ]; then \
1078 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1082 # Take out texinfo from a few places; make simple BISON=bison line.
1083 sed -e '/^all\.normal: /s/\all-texinfo //' \
1084 -e '/^ install-texinfo /d' \
1085 -e '/^BISON = /,/^$$/d' \
1086 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1088 mv -f tmp Makefile.in
1091 # Doc files don't change; include them in distribution.
1092 for f in $(DISTDOCDIRS) ; do \
1093 if [ -r $$f/Makefile ]; then \
1094 (cd $$f ; $(MAKE) info) || exit 1 ; \
1097 # Make links, and run "make diststuff" when needed.
1098 # The `echo' for setting `p' is to convert all whitespace to spaces.
1099 # Then the `case' further below should tell whether $$d is in
1101 rm -rf proto-toplev ; mkdir proto-toplev
1102 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1103 p=" `echo $(DISTSTUFFDIRS)` " ; \
1104 for d in $$dirs ; do \
1105 if [ -d $$d ]; then \
1108 echo making diststuff in $$d ; \
1109 (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1 ;; \
1111 if [ -d $$d/proto-$$d.dir ]; then \
1112 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1114 ln -s ../$$d proto-toplev/$$d ; \
1116 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1120 mkdir proto-toplev/etc
1121 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1122 ln -s ../../etc/$$i . ; \
1125 # Take out texinfo and glob from configurable dirs
1126 rm proto-toplev/configure.in
1127 sed -e '/^host_tools=/s/texinfo //' \
1128 -e '/^host_libs=/s/glob //' \
1129 <configure.in >proto-toplev/configure.in
1131 mkdir proto-toplev/texinfo
1132 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1133 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1134 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1135 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1136 chmod og=u `find . -print`
1137 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1138 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1139 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1140 tar cfh - $(TOOL)-$$VER \
1141 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1143 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1144 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1147 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1148 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1149 $(MAKE) -f Makefile.in taz TOOL=gas \
1150 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1152 # The FSF "binutils" release includes gprof and ld.
1153 .PHONY: binutils.tar.gz
1154 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1155 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1156 $(MAKE) -f Makefile.in taz TOOL=binutils \
1157 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1159 .PHONY: gas+binutils.tar.gz
1160 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1161 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1162 $(MAKE) -f Makefile.in taz TOOL=gas \
1163 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1165 .PHONY: libg++.tar.gz
1166 LIBGXX_SUPPORT_DIRS=include libio libiberty xiberty
1167 libg++.tar.gz: $(DIST_SUPPORT) libg++
1168 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1169 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1171 GNATS_SUPPORT_DIRS=include libiberty send-pr
1172 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1173 $(MAKE) -f Makefile.in taz TOOL=gnats \
1174 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
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