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)
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.
76 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
77 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
78 then echo $${rootme}/byacc/byacc ; \
82 LEX = `if [ -f $${rootme}/flex/flex ] ; \
83 then echo $${rootme}/flex/flex ; \
86 M4 = `if [ -f $${rootme}/m4/m4 ] ; \
87 then echo $${rootme}/m4/m4 ; \
90 MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
91 then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
92 else echo makeinfo ; fi`
93 # This just becomes part of the MAKEINFO definition passed down to
94 # sub-makes. It lets flags be given on the command line while still
95 # using the makeinfo from the object tree.
98 EXPECT = `if [ -f $${rootme}/expect/expect ] ; \
99 then echo $${rootme}/expect/expect ; \
100 else echo expect ; fi`
102 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
103 then echo $${srcroot}/dejagnu/runtest ; \
104 else echo runtest ; fi`
107 # libraries that may need to be augmented on a system-by-system basis
110 # compilers to use to create programs which must be run in the build
113 CXX_FOR_BUILD = $(CXX)
115 SUBDIRS = "this is set via configure, don't edit this"
119 INSTALL_TARGET = install-dirs \
121 $(INSTALL_TARGET_MODULES) \
122 $(INSTALL_X11_MODULES) \
126 if [ -f $${rootme}/gcc/Makefile ] ; then \
127 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
129 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
132 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
136 # start-sanitize-chill
137 CHILL_FOR_TARGET = ` \
138 if [ -f $${rootme}/gcc/Makefile ] ; then \
139 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
141 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
144 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
151 if [ -f $${rootme}/gcc/Makefile ] ; then \
152 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
154 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
157 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
162 if [ -f $${rootme}/gas/Makefile ] ; then \
163 echo $${rootme}/gas/as.new ; \
165 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
168 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
173 if [ -f $${rootme}/binutils/ar ] ; then \
174 echo $${rootme}/binutils/ar ; \
176 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
179 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
183 RANLIB_FOR_TARGET = ` \
184 if [ -f $${rootme}/binutils/ranlib ] ; then \
185 echo $${rootme}/binutils/ranlib ; \
187 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
190 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
195 if [ -f $${rootme}/binutils/Makefile ] ; then \
196 echo $${rootme}/binutils/nm ; \
198 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
201 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
205 # FIXME: This is badly named.
207 if [ -f $${rootme}/gcc/Makefile ] ; then \
208 if [ -f $${rootme}/newlib/Makefile ] ; then \
209 echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
211 echo -I$${rootme}/gcc/include ; \
217 #### host and target specific makefile fragments come in here.
220 # Flags to pass down to all sub-makes.
221 # Please keep these in alphabetical order.
222 BASE_FLAGS_TO_PASS = \
223 "AR_FLAGS=$(AR_FLAGS)" \
224 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
225 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
227 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
228 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
230 $(start-sanitize-chill)\
231 "CHILLFLAGS=$(CHILLFLAGS)" \
232 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
233 "CHILL_LIB=$(CHILL_LIB)" \
234 $(end-sanitize-chill)\
235 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
236 "CXXFLAGS=$(CXXFLAGS)" \
237 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
238 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
239 "INSTALL=$(INSTALL)" \
240 "INSTALL_DATA=$(INSTALL_DATA)" \
241 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
242 "INSTALL_XFORM=$(INSTALL_XFORM)" \
243 "LDFLAGS=$(LDFLAGS)" \
246 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
247 "MUNCH_NM=$(MUNCH_NM)" \
248 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
249 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
251 "RUNTEST=$(RUNTEST)" \
252 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
253 "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
254 "exec_prefix=$(exec_prefix)" \
258 # Flags to pass down to most sub-makes, in which we're building with
259 # the host environment.
260 # If any variables are added here, they must be added to do-*, below.
270 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
272 # Flags that are concerned with the location of the X11 include files
274 X11_FLAGS_TO_PASS = \
275 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
276 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
279 # Flags to pass down to makes which are built with the target environment.
280 # The double $ decreases the length of the command line; the variables
281 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
282 # If any variables are added here, they must be added to do-*, below.
283 EXTRA_TARGET_FLAGS = \
284 'AR=$$(AR_FOR_TARGET)' \
285 'AS=$$(AS_FOR_TARGET)' \
286 'CC=$$(CC_FOR_TARGET)' \
287 'CXX=$$(CXX_FOR_TARGET)' \
288 'NM=$$(NM_FOR_TARGET)' \
289 'RANLIB=$$(RANLIB_FOR_TARGET)' \
290 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
292 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
294 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
295 # unfortunately needs the native compiler and the target ar and
297 # If any variables are added here, they must be added to do-*, below.
298 # The HOST_* variables are a special case, which are used for the gcc
299 # cross-building scheme.
300 HOST_CC = $(CC_FOR_BUILD)
302 HOST_PREFIX_1 = loser-
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)' \
315 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
317 # This is a list of the targets for all of the modules which are compiled
318 # 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).
464 # This is a list of the targets for all of the modules which are compiled
465 # using $(X11_FLAGS_TO_PASS).
473 # This is a list of the check targets for all of the modules which are
474 # compiled using $(X11_FLAGS_TO_PASS).
475 CHECK_X11_MODULES = \
482 # This is a list of the install targets for all the modules which are
483 # compiled using $(X11_FLAGS_TO_PASS).
484 INSTALL_X11_MODULES = \
491 # This is a list of the targets for all of the modules which are compiled
492 # using $(TARGET_FLAGS_TO_PASS).
493 ALL_TARGET_MODULES = \
494 $(start-sanitize-chill) \
496 $(end-sanitize-chill) \
502 # This is a list of the check targets for all of the modules which are
503 # compiled using $(TARGET_FLAGS_TO_PASS).
504 CHECK_TARGET_MODULES = \
505 $(start-sanitize-chill) \
507 $(end-sanitize-chill) \
513 # This is a list of the install targets for all of the modules which are
514 # compiled using $(TARGET_FLAGS_TO_PASS).
515 INSTALL_TARGET_MODULES = \
516 $(start-sanitize-chill) \
518 $(end-sanitize-chill) \
524 # This is a shell case of all modules which are compiled using
525 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
526 TARGET_LIBS = libio | libg++ | newlib | xiberty
527 # start-sanitize-chill
528 TARGET_LIBS = chillrt | libio | libg++ | newlib | xiberty
531 # The first rule in the file had better be this one. Don't put any above it.
535 # The target built for a native build.
539 $(ALL_TARGET_MODULES) \
543 # Do a target for all the subdirectories. A ``make do-X'' will do a
544 # ``make X'' in all subdirectories (because, in general, there is a
545 # dependency (below) of X upon do-X, a ``make X'' will also do this,
546 # but it may do additional work as well).
547 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
548 # because it is so large that it can easily overflow the command line
549 # length limit on some systems.
561 @target=`echo $@ | sed -e 's/^do-//'`; \
562 rootme=`pwd`; export rootme; \
563 srcroot=`cd $(srcdir); pwd`; export srcroot; \
564 for i in $(SUBDIRS); do \
565 if [ -f ./$$i/Makefile ]; then \
568 for flag in $(EXTRA_TARGET_FLAGS); do \
569 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
573 for flag in $(EXTRA_GCC_FLAGS); do \
574 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
578 for flag in $(EXTRA_HOST_FLAGS); do \
579 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
583 export AR AS CC CXX NM RANLIB XTRAFLAGS; \
585 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
586 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
587 "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
589 then true; else exit 1; fi; \
593 # Here are the targets which correspond to the do-X targets.
595 .PHONY: info installcheck dvi install-info
596 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
598 installcheck: do-installcheck
601 install-info: do-install-info dir.info
602 srcroot=`cd $(srcdir); pwd`; export srcroot; \
603 if [ -f dir.info ] ; then \
604 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
608 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
611 -rm -f Makefile config.status
613 clean: do-clean local-clean
614 mostlyclean: do-mostlyclean local-clean
615 distclean: do-distclean local-clean local-distclean
616 realclean: do-realclean local-clean local-distclean
621 check: $(CHECK_MODULES) \
622 $(CHECK_TARGET_MODULES) \
623 $(CHECK_X11_MODULES) \
626 # Installation targets.
628 .PHONY: install uninstall vault-install
629 install: $(INSTALL_TARGET)
632 @echo "the uninstall target is not supported in this tree"
635 @if [ -f ./release/vault-install ] ; then \
636 ./release/vault-install $(host_alias) $(target_alias) ; \
642 install.all: install-no-fixedincludes
643 @if [ -f ./gcc/Makefile ] ; then \
644 rootme=`pwd` ; export rootme ; \
646 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
651 # install-no-fixedincludes is used because Cygnus can not distribute
652 # the fixed header files.
653 .PHONY: install-no-fixedincludes
654 install-no-fixedincludes: \
657 $(INSTALL_TARGET_MODULES) \
658 $(INSTALL_X11_MODULES) \
661 # Install the gcc headers files, but not the fixed include files,
662 # which Cygnus is not allowed to distribute. This rule is very
663 # dependent on the workings of the gcc Makefile.in.
664 .PHONY: gcc-no-fixedincludes
665 gcc-no-fixedincludes:
666 @if [ -f ./gcc/Makefile ]; then \
667 rm -rf gcc/tmp-include; \
668 mv gcc/include gcc/tmp-include 2>/dev/null; \
670 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
671 touch gcc/stmp-fixinc gcc/stmp-fixproto; \
672 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
673 rootme=`pwd`; export rootme; \
674 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
676 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
677 rm -rf gcc/include; \
678 mv gcc/tmp-include gcc/include 2>/dev/null; \
681 # This rule is used to build the modules which use FLAGS_TO_PASS. To
682 # build a target all-X means to cd to X and make all.
683 # all-glob is handled specially because it doesn't actually build.
684 .PHONY: $(ALL_MODULES) all-glob
685 $(ALL_MODULES) all-glob:
686 @dir=`echo $@ | sed -e 's/all-//'`; \
687 if [ -f ./$${dir}/Makefile ] ; then \
688 rootme=`pwd`; export rootme; \
689 srcroot=`cd $(srcdir); pwd`; export srcroot; \
690 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
695 # This rule is used to check the modules which use FLAGS_TO_PASS. To
696 # build a target check-X means to cd to X and make all.
697 .PHONY: $(CHECK_MODULES)
699 @dir=`echo $@ | sed -e 's/check-//'`; \
700 if [ -f ./$${dir}/Makefile ] ; then \
701 rootme=`pwd`; export rootme; \
702 srcroot=`cd $(srcdir); pwd`; export srcroot; \
703 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
708 # This rule is used to install the modules which use FLAGS_TO_PASS.
709 # To build a target install-X means to cd to X and make install.
710 .PHONY: $(INSTALL_MODULES)
711 $(INSTALL_MODULES): install-dirs
712 @dir=`echo $@ | sed -e 's/install-//'`; \
713 if [ -f ./$${dir}/Makefile ] ; then \
714 rootme=`pwd`; export rootme; \
715 srcroot=`cd $(srcdir); pwd`; export srcroot; \
716 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
721 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
722 # To build a target all-X means to cd to X and make all.
723 .PHONY: $(ALL_TARGET_MODULES)
724 $(ALL_TARGET_MODULES):
725 @dir=`echo $@ | sed -e 's/all-//'`; \
726 if [ -f ./$${dir}/Makefile ] ; then \
727 rootme=`pwd`; export rootme; \
728 srcroot=`cd $(srcdir); pwd`; export srcroot; \
729 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
734 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
735 # To build a target install-X means to cd to X and make install.
736 .PHONY: $(CHECK_TARGET_MODULES)
737 $(CHECK_TARGET_MODULES):
738 @dir=`echo $@ | sed -e 's/check-//'`; \
739 if [ -f ./$${dir}/Makefile ] ; then \
740 rootme=`pwd`; export rootme; \
741 srcroot=`cd $(srcdir); pwd`; export srcroot; \
742 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
747 # This rule is used to install the modules which use
748 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
750 .PHONY: $(INSTALL_TARGET_MODULES)
751 $(INSTALL_TARGET_MODULES): install-dirs
752 @dir=`echo $@ | sed -e 's/install-//'`; \
753 if [ -f ./$${dir}/Makefile ] ; then \
754 rootme=`pwd`; export rootme; \
755 srcroot=`cd $(srcdir); pwd`; export srcroot; \
756 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
761 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
762 # To build a target all-X means to cd to X and make all.
763 .PHONY: $(ALL_X11_MODULES)
765 @dir=`echo $@ | sed -e 's/all-//'`; \
766 if [ -f ./$${dir}/Makefile ] ; then \
767 rootme=`pwd`; export rootme; \
768 srcroot=`cd $(srcdir); pwd`; export srcroot; \
770 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
775 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
776 # To build a target check-X means to cd to X and make all.
777 .PHONY: $(CHECK_X11_MODULES)
778 $(CHECK_X11_MODULES):
779 @dir=`echo $@ | sed -e 's/check-//'`; \
780 if [ -f ./$${dir}/Makefile ] ; then \
781 rootme=`pwd`; export rootme; \
782 srcroot=`cd $(srcdir); pwd`; export srcroot; \
784 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
789 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
790 # To build a target install-X means to cd to X and make install.
791 .PHONY: $(INSTALL_X11_MODULES)
792 $(INSTALL_X11_MODULES):
793 @dir=`echo $@ | sed -e 's/install-//'`; \
794 if [ -f ./$${dir}/Makefile ] ; then \
795 rootme=`pwd`; export rootme; \
796 srcroot=`cd $(srcdir); pwd`; export srcroot; \
798 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
803 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
806 @if [ -f ./gcc/Makefile ] ; then \
807 rootme=`pwd`; export rootme; \
808 srcroot=`cd $(srcdir); pwd`; export srcroot; \
809 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
816 @if [ -f ./gcc/Makefile ] ; then \
817 rootme=`pwd`; export rootme; \
818 srcroot=`cd $(srcdir); pwd`; export srcroot; \
819 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
826 @if [ -f ./gcc/Makefile ] ; then \
827 rootme=`pwd`; export rootme; \
828 srcroot=`cd $(srcdir); pwd`; export srcroot; \
829 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
834 # This is a list of inter-dependencies among modules.
837 all-binutils: all-libiberty all-opcodes all-bfd all-flex
839 # start-sanitize-chill
840 all-chillrt: all-binutils all-gas all-gcc all-newlib
844 all-diff: all-libiberty
847 all-expect: all-tcl all-tk
848 all-fileutils: all-libiberty
850 all-flex: all-libiberty all-byacc
851 all-gas: all-libiberty all-opcodes all-bfd
854 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
855 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
857 all-gprof: all-libiberty all-bfd
858 all-grep: all-libiberty
859 all-gzip: all-libiberty
860 all-hello: all-libiberty
862 all-ispell: all-emacs
863 all-ld: all-libiberty all-bfd all-byacc all-flex
864 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
865 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
867 all-m4: all-libiberty
868 all-make: all-libiberty
870 all-newlib: all-binutils all-gas all-pagas all-gcc
873 all-prms: all-libiberty
876 all-recode: all-libiberty
877 all-sed: all-libiberty
878 all-send-pr: all-prms
880 all-sim: all-libiberty all-bfd
881 all-tar: all-libiberty
883 all-tclX: all-tcl all-tk
885 all-texinfo: all-libiberty
887 all-tgas: all-libiberty all-bfd
890 all-uudecode: all-libiberty
891 all-xiberty: all-gcc all-newlib
893 ### other supporting targets
902 @for i in $(MAKEDIRS) ; do \
903 echo Making $$i... ; \
904 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
905 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
906 if [ ! -d $$i ] ; then \
907 if mkdir $$i ; then \
918 dir.info: do-install-info
919 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
920 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
921 mv -f dir.info.new dir.info ; \
926 @echo "Building a full distribution of this tree isn't done"
927 @echo "via 'make dist'. Check out the etc/ subdirectory"
936 @for i in $(SUBDIRS); \
940 wd=`basename $$pwd`; \
941 for j in `$(MAKE) ls`; \
947 # with the gnu make, this is done automatically.
949 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
950 $(SHELL) ./config.status
953 # Support for building net releases
955 # Files in devo used in any net release.
956 # ChangeLog omitted because it may refer to files which are not in this
957 # distribution (perhaps it would be better to include it anyway).
958 DEVO_SUPPORT= README Makefile.in configure configure.in \
959 config.guess config.sub config move-if-change \
960 COPYING COPYING.LIB install.sh
962 # Files in devo/etc used in any net release.
963 # ChangeLog omitted because it may refer to files which are not in this
964 # distribution (perhaps it would be better to include it anyway).
965 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
966 configure.texi standards.texi make-stds.texi
968 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
969 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
971 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
976 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
978 gdb.tar.gz: setup-dirs-gdb
979 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
980 (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
981 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
983 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
984 rm -rf proto-toplev; mkdir proto-toplev
985 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
986 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
989 mkdir proto-toplev/etc
990 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
991 ln -s ../../etc/$$i . ; \
993 # Put only one copy (four hard links) of COPYING in the tar file.
994 rm proto-toplev/bfd/COPYING
995 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
996 rm proto-toplev/include/COPYING
997 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
998 rm proto-toplev/readline/COPYING
999 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1001 # Change the bug reporting address in configure to bug-gdb
1002 rm proto-toplev/configure
1003 sed -e 's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
1004 <configure >proto-toplev/configure
1005 chmod a+x proto-toplev/configure
1007 # Take out texinfo and glob from configurable dirs
1008 rm proto-toplev/configure.in
1009 sed -e '/^host_tools=/s/texinfo //' \
1010 -e '/^host_libs=/s/glob //' \
1011 <configure.in >proto-toplev/configure.in
1013 # Take out texinfo from a few places; make simple BISON=bison line.
1014 rm proto-toplev/Makefile.in
1015 sed -e '/^all\.normal: /s/\all-texinfo //' \
1016 -e '/^ install-texinfo /d' \
1017 -e '/^BISON = /,/^$$/d' \
1018 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1019 <Makefile.in >proto-toplev/Makefile.in
1021 mkdir proto-toplev/texinfo
1022 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1023 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1024 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1025 chmod og=u `find proto-toplev -print`
1026 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1027 echo "==> Making gdb-$$VER.tar.gz"; \
1028 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1029 tar cfh - gdb-$$VER \
1030 | $(GZIP) -v -9 >gdb-$$VER.tar.gz)
1032 # Make the testsuite archive separately.
1033 ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1034 # Blow away the Chill test that requires a Chill compiled executable,
1035 # since GNU Chill is not yet publically available.
1036 rm -rf proto-toplev/gdb/testsuite/gdb.t31
1038 # Put a copy of COPYING in the tar file.
1039 ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1040 chmod og=u `find proto-toplev/gdb/testsuite -print`
1041 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1042 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1043 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1044 gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1045 gdb-$$VER/gdb/testsuite \
1046 | $(GZIP) -v -9 >gdb-$$VER-testsuite.tar.gz)
1048 # When you use `make setup-dirs' or `make taz' you should always redefine
1050 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1051 # Directories that might want `make diststuff' run.
1052 DISTSTUFFDIRS= ld gprof gdb libg++ binutils
1053 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1054 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1058 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex texinfo/gpl.texinfo
1059 # Do this first so "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 ; \
1068 # Make links, and run "make diststuff" when needed.
1069 # The `echo' for setting `p' is to convert all whitespace to spaces.
1070 # Then the `case' further below should tell whether $$d is in
1072 rm -rf proto-toplev ; mkdir proto-toplev
1073 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1074 p=" `echo $(DISTSTUFFDIRS)` " ; \
1075 for d in $$dirs ; do \
1076 if [ -d $$d ]; then \
1079 echo making diststuff in $$d ; \
1080 (cd $$d ; pwd ; $(MAKE) diststuff BISON="bison -y") || exit 1 ;; \
1082 if [ -d $$d/proto-$$d.dir ]; then \
1083 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1085 ln -s ../$$d proto-toplev/$$d ; \
1087 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1091 mkdir proto-toplev/etc
1092 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1093 ln -s ../../etc/$$i . ; \
1096 # Take out texinfo and glob from configurable dirs
1097 rm proto-toplev/configure.in
1098 sed -e '/^host_tools=/s/texinfo //' \
1099 -e '/^host_libs=/s/glob //' \
1100 <configure.in >proto-toplev/configure.in
1102 # Take out texinfo from a few places; make simple BISON=bison line.
1103 rm proto-toplev/Makefile.in
1104 sed -e '/^all\.normal: /s/\all-texinfo //' \
1105 -e '/^ install-texinfo /d' \
1106 -e '/^BISON = /,/^$$/d' \
1107 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1108 <Makefile.in >proto-toplev/Makefile.in
1110 mkdir proto-toplev/texinfo
1111 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1112 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1113 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1114 chmod og=u `find . -print`
1115 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1116 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1117 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1118 tar cfh - $(TOOL)-$$VER \
1119 | $(GZIP) -v -9 >$(TOOL)-$$VER.tar.gz)
1121 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo
1122 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1125 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1126 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1127 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
1129 # The FSF "binutils" release includes gprof and ld.
1130 .PHONY: binutils.tar.gz
1131 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1132 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1133 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" TOOL=binutils
1135 .PHONY: gas+binutils.tar.gz
1136 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1137 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1138 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" TOOL=gas
1140 .PHONY: libg++.tar.gz
1141 LIBGXX_SUPPORT_DIRS=include libio libiberty xiberty
1142 libg++.tar.gz: $(DIST_SUPPORT) libg++
1143 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" TOOL=libg++
1148 # start-sanitize-chill
1149 ## This is ugly, but I don't want GNU make to put these variables in
1150 ## the environment. Older makes will see this as a set of targets
1151 ## with no dependencies and no actions.
1152 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1153 # end-sanitize-chill
1155 # end of Makefile.in