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
29 program_transform_name =
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
57 # start-sanitize-chill
58 CHILLFLAGS = $(CFLAGS)
68 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
69 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
70 then echo $${rootme}/byacc/byacc ; \
74 LEX = `if [ -f $${rootme}/flex/flex ] ; \
75 then echo $${rootme}/flex/flex ; \
78 MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
79 then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
80 else echo makeinfo ; fi`
83 # libraries that may need to be augmented on a system-by-system basis
86 # compilers to use to create programs which must be run in the build
89 CXX_FOR_BUILD = $(CXX)
91 SUBDIRS = "this is set via configure, don't edit this"
95 INSTALL_TARGET = install.all
98 if [ -f $${rootme}/gcc/Makefile ] ; then \
99 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
101 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
104 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
108 # start-sanitize-chill
109 CHILL_FOR_TARGET = ` \
110 if [ -f $${rootme}/gcc/Makefile ] ; then \
111 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
113 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
116 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
123 if [ -f $${rootme}/gcc/Makefile ] ; then \
124 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
126 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
129 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
134 if [ -f $${rootme}/gas/Makefile ] ; then \
135 echo $${rootme}/gas/as.new ; \
137 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
140 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
145 if [ -f $${rootme}/binutils/Makefile ] ; then \
146 echo $${rootme}/binutils/ar ; \
148 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
151 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
155 RANLIB_FOR_TARGET = ` \
156 if [ -f $${rootme}/binutils/Makefile ] ; then \
157 echo $${rootme}/binutils/ranlib ; \
159 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
162 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
167 if [ -f $${rootme}/binutils/Makefile ] ; then \
168 echo $${rootme}/binutils/nm ; \
170 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
173 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
177 # FIXME: This is badly named.
179 if [ -f $${rootme}/gcc/Makefile ] ; then \
180 if [ -f $${rootme}/newlib/Makefile ] ; then \
181 echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
183 echo -I$${rootme}/gcc/include ; \
191 #### host and target specific makefile fragments come in here.
194 # Flags to pass down to all sub-makes.
195 # Please keep these in alphabetical order.
196 BASE_FLAGS_TO_PASS = \
197 "AR_FLAGS=$(AR_FLAGS)" \
198 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
199 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
201 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
202 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
204 $(start-sanitize-chill)\
205 "CHILLFLAGS=$(CHILLFLAGS)" \
206 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
207 "CHILL_LIB=$(CHILL_LIB)" \
208 $(end-sanitize-chill)\
209 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
210 "CXXFLAGS=$(CXXFLAGS)" \
211 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
212 'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
213 "INSTALL=$(INSTALL)" \
214 "INSTALL_DATA=$(INSTALL_DATA)" \
215 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
216 "LDFLAGS=$(LDFLAGS)" \
218 "LOADLIBES=$(LOADLIBES)" \
219 "MAKEINFO=$(MAKEINFO)" \
220 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
222 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
223 "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
224 "exec_prefix=$(exec_prefix)" \
228 # Flags to pass down to most sub-makes, in which we're building with
229 # the host environment.
230 # If any variables are added here, they must be added to do-*, below.
240 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
242 # Flags that are concerned with the location of the X11 include files
244 X11_FLAGS_TO_PASS = \
245 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
246 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
249 # Flags to pass down to makes which are built with the target environment.
250 # The double $ decreases the length of the command line; the variables
251 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
252 # If any variables are added here, they must be added to do-*, below.
253 EXTRA_TARGET_FLAGS = \
254 'AR=$$(AR_FOR_TARGET)' \
255 'AS=$$(AS_FOR_TARGET)' \
256 'CC=$$(CC_FOR_TARGET)' \
257 'CXX=$$(CXX_FOR_TARGET)' \
258 'NM=$$(NM_FOR_TARGET)' \
259 'RANLIB=$$(RANLIB_FOR_TARGET)' \
260 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
262 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
264 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
265 # unfortunately needs the native compiler and the target ar and
267 # If any variables are added here, they must be added to do-*, below.
269 'AR=$$(AR_FOR_TARGET)' \
274 'RANLIB=$$(RANLIB_FOR_TARGET)' \
277 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
279 # This is a list of the targets for all the modules which are compiled
280 # using $(FLAGS_TO_PASS).
326 # This is a list of the install targets for all the modules which are
327 # compiled using $(FLAGS_TO_PASS).
374 # This is a list of the targets for all the modules which are compiled
375 # using $(X11_FLAGS_TO_PASS).
382 # This is a list of the install targets for all the modules which are
383 # compiled using $(X11_FLAGS_TO_PASS).
384 INSTALL_X11_MODULES = \
390 # This is a list of the targets for all the modules which are compiled
391 # using $(TARGET_FLAGS_TO_PASS).
392 ALL_TARGET_MODULES = \
393 $(start-sanitize-chill) \
395 $(end-sanitize-chill) \
400 # This is a list of the install targets for all the modules which are
401 # compiled using $(TARGET_FLAGS_TO_PASS).
402 INSTALL_TARGET_MODULES = \
403 $(start-sanitize-chill) \
405 $(end-sanitize-chill) \
410 # This is a shell case of all modules which are compiled using
411 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
412 TARGET_LIBS = libg++ | newlib | xiberty
413 # start-sanitize-chill
414 TARGET_LIBS = chillrt | libg++ | newlib | xiberty
417 # The first rule in the file had better be this one. Don't put any above it.
421 # The target built for a native build.
425 $(ALL_TARGET_MODULES) \
429 # The target built for a cross build.
446 $(ALL_TARGET_MODULES)
448 # Do a target for all the subdirectories. A ``make do-X'' will do a
449 # ``make X'' in all subdirectories (because, in general, there is a
450 # dependency (below) of X upon do-X, a ``make X'' will also do this,
451 # but it may do additional work as well).
452 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
453 # because it is so large that it can easily overflow the command line
454 # length limit on some systems.
467 @target=`echo $@ | sed -e 's/^do-//'`; \
468 rootme=`pwd`; export rootme; \
469 srcroot=`cd $(srcdir); pwd`; export srcroot; \
470 for i in $(SUBDIRS); do \
471 if [ -f ./$$i/Makefile ]; then \
474 for flag in $(EXTRA_TARGET_FLAGS); do \
475 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
479 for flag in $(EXTRA_GCC_FLAGS); do \
480 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
484 for flag in $(EXTRA_HOST_FLAGS); do \
485 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
489 export AR AS CC CXX NM RANLIB XTRAFLAGS; \
491 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
492 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
493 "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
495 then true; else exit 1; fi; \
499 # Here are the targets which correspond to the do-X targets.
501 .PHONY: info check installcheck dvi install-info
502 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
505 installcheck: do-installcheck
508 install-info: install-info-dirs do-install-info dir.info
509 if [ -f dir.info ] ; then \
510 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
513 do-install-info: install-info-dirs
516 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
519 -rm -f Makefile config.status
521 clean: do-clean local-clean
522 mostlyclean: do-mostlyclean local-clean
523 distclean: do-distclean local-clean local-distclean
524 realclean: do-realclean local-clean local-distclean
526 # Installation targets.
528 .PHONY: install uninstall
529 install: $(INSTALL_TARGET)
532 @echo "the uninstall target is not supported in this tree"
535 install.all: install-no-fixedincludes
536 @if [ -f ./gcc/Makefile ] ; then \
537 rootme=`pwd` ; export rootme ; \
539 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
544 # install-no-fixedincludes is used because Cygnus can not distributed
545 # the fixed header files.
546 .PHONY: install-no-fixedincludes
547 install-no-fixedincludes: \
549 gcc-no-fixedincludes \
551 $(INSTALL_TARGET_MODULES) \
552 $(INSTALL_X11_MODULES)
554 # Install the gcc headers files, but not the fixed include files,
555 # which Cygnus is not allowed to distribute. This rule is very
556 # dependent on the workings of the gcc Makefile.in.
557 .PHONY: gcc-no-fixedincludes
558 gcc-no-fixedincludes:
559 @if [ -f ./gcc/Makefile ]; then \
560 rm -rf gcc/tmp-include; \
561 mv gcc/include gcc/tmp-include 2>/dev/null; \
563 touch gcc/stmp-fixincludes; \
564 rm -f gcc/stmp-headers; \
565 rootme=`pwd`; export rootme; \
566 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
568 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
569 rm -rf gcc/include; \
570 mv gcc/tmp-include gcc/include 2>/dev/null; \
573 .PHONY: install.cross
590 $(INSTALL_TARGET_MODULES)
592 # This rule is used to build the modules which use FLAGS_TO_PASS. To
593 # build a target all-X means to cd to X and make all.
594 # all-glob is handled specially because it doesn't actually build.
595 .PHONY: $(ALL_MODULES) all-glob
596 $(ALL_MODULES) all-glob:
597 @dir=`echo $@ | sed -e 's/all-//'`; \
598 if [ -f ./$${dir}/Makefile ] ; then \
599 rootme=`pwd`; export rootme; \
600 srcroot=`cd $(srcdir); pwd`; export srcroot; \
601 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
606 # This rule is used to install the modules which use FLAGS_TO_PASS.
607 # To build a target install-X means to cd to X and make install.
608 .PHONY: $(INSTALL_MODULES)
609 $(INSTALL_MODULES): install-dirs
610 @dir=`echo $@ | sed -e 's/install-//'`; \
611 if [ -f ./$${dir}/Makefile ] ; then \
612 rootme=`pwd`; export rootme; \
613 srcroot=`cd $(srcdir); pwd`; export srcroot; \
614 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
619 # This rule is used the build the modules which use
620 # TARGET_FLAGS_TO_PASS. To build a target all-X means to cd to X and
622 .PHONY: $(ALL_TARGET_MODULES)
623 $(ALL_TARGET_MODULES):
624 @dir=`echo $@ | sed -e 's/all-//'`; \
625 if [ -f ./$${dir}/Makefile ] ; then \
626 rootme=`pwd`; export rootme; \
627 srcroot=`cd $(srcdir); pwd`; export srcroot; \
628 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
633 # This rule is used to install the modules which use
634 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
636 .PHONY: $(INSTALL_TARGET_MODULES)
637 $(INSTALL_TARGET_MODULES): install-dirs
638 @dir=`echo $@ | sed -e 's/install-//'`; \
639 if [ -f ./$${dir}/Makefile ] ; then \
640 rootme=`pwd`; export rootme; \
641 srcroot=`cd $(srcdir); pwd`; export srcroot; \
642 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
647 # This rule is used the build the modules which use X11_FLAGS_TO_PASS.
648 # To build a target all-X means to cd to X and make all.
649 .PHONY: $(ALL_X11_MODULES)
651 @dir=`echo $@ | sed -e 's/all-//'`; \
652 if [ -f ./$${dir}/Makefile ] ; then \
653 rootme=`pwd`; export rootme; \
654 srcroot=`cd $(srcdir); pwd`; export srcroot; \
656 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
661 # This rule is used the install the modules which use X11_FLAGS_TO_PASS.
662 # To build a target install-X means to cd to X and make install.
663 .PHONY: $(INSTALL_X11_MODULES)
664 $(INSTALL_X11_MODULES):
665 @dir=`echo $@ | sed -e 's/all-//'`; \
666 if [ -f ./$${dir}/Makefile ] ; then \
667 rootme=`pwd`; export rootme; \
668 srcroot=`cd $(srcdir); pwd`; export srcroot; \
670 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
675 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
678 @if [ -f ./gcc/Makefile ] ; then \
679 rootme=`pwd`; export rootme; \
680 srcroot=`cd $(srcdir); pwd`; export srcroot; \
681 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
688 @if [ -f ./gcc/Makefile ] ; then \
689 rootme=`pwd`; export rootme; \
690 srcroot=`cd $(srcdir); pwd`; export srcroot; \
691 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
696 # This is a list of inter-dependencies among modules.
699 all-binutils: all-libiberty all-opcodes all-bfd all-flex
701 # start-sanitize-chill
702 all-chillrt: all-binutils all-gas all-gcc all-newlib
706 all-diff: all-libiberty
712 all-flex: all-libiberty all-byacc
713 all-gas: all-libiberty all-opcodes all-bfd
715 all-gcc: all-libiberty all-byacc all-binutils all-gas
716 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc
718 all-gprof: all-libiberty all-bfd
720 all-gzip: all-libiberty
721 all-hello: all-libiberty
723 all-ispell: all-emacs
724 all-ld: all-libiberty all-bfd all-byacc all-flex
725 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
727 all-m4: all-libiberty
728 all-make: all-libiberty
730 all-newlib: all-binutils all-gas all-gcc
736 all-recode: all-libiberty
740 all-sim: all-libiberty all-bfd
741 all-tar: all-libiberty
743 all-tclX: all-tcl all-tk
745 all-texinfo: all-libiberty
747 all-tgas: all-libiberty all-bfd
750 all-uudecode: all-libiberty
751 all-xiberty: all-gcc all-newlib
753 ### other supporting targets
762 @for i in $(MAKEDIRS) ; do \
763 echo Making $$i... ; \
764 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
765 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
766 if [ ! -d $$i ] ; then \
767 if mkdir $$i ; then \
777 .PHONY: install-info-dirs
779 if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
780 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
781 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
782 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
784 dir.info: do-install-info
785 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
786 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
787 mv -f dir.info.new dir.info ; \
792 @echo "Building a full distribution of this tree isn't done"
793 @echo "via 'make dist'. Check out the etc/ subdirectory"
802 @for i in $(SUBDIRS); \
806 wd=`basename $$pwd`; \
807 for j in `$(MAKE) ls`; \
813 # with the gnu make, this is done automatically.
815 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
816 $(SHELL) ./config.status
819 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
821 DEVO_SUPPORT= README Makefile.in configure configure.in \
822 config.guess config.sub config move-if-change
823 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
825 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
826 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
828 .PHONY: setup-dirs-gdb gdb.tar.Z make-gdb.tar.Z
833 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
835 gdb.tar.Z: setup-dirs-gdb
836 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
837 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
839 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
840 rm -rf proto-toplev; mkdir proto-toplev
841 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
842 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
845 mkdir proto-toplev/etc
846 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
847 ln -s ../../etc/$$i . ; \
849 # Put only one copy (four hard links) of COPYING in the tar file.
850 rm proto-toplev/bfd/COPYING
851 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
852 rm proto-toplev/include/COPYING
853 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
854 rm proto-toplev/readline/COPYING
855 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
857 # Take out texinfo and glob from configurable dirs
858 rm proto-toplev/configure.in
859 sed -e '/^host_tools=/s/texinfo //' \
860 -e '/^host_libs=/s/glob //' \
861 <configure.in >proto-toplev/configure.in
863 # Take out texinfo from a few places; make simple BISON=bison line.
864 rm proto-toplev/Makefile.in
865 sed -e '/^all\.normal: /s/\all-texinfo //' \
866 -e '/^ install-texinfo /d' \
867 -e '/^BISON = /,/^$$/d' \
868 -e '/^# BISON:/s/.*/BISON = bison -y/' \
869 <Makefile.in >proto-toplev/Makefile.in
871 mkdir proto-toplev/texinfo
872 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
873 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
874 chmod og=u `find proto-toplev -print`
875 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
876 ln -s proto-toplev gdb-$$VER; \
877 echo "==> Making gdb-$$VER.tar.Z"; \
878 tar cfh - gdb-$$VER | $(COMPRESS) -v >gdb-$$VER.tar.Z; \
879 echo "==> Making gdb-$$VER.tar.z"; \
880 tar cfh - gdb-$$VER | $(GZIP) -v -9 >gdb-$$VER.tar.z)
882 # When you use `make setup-dirs' or `make taz' you should always redefine
884 SUPPORT_FILES = list-of-support-files-for-tool-in-question
885 # Directories that might want `make proto-dir' run.
888 .PHONY: setup-dirs taz
893 chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) -print`
894 for d in .. $(PROTODIRS) ; do \
895 if [ $$d != ".." ] && [ -d $$d ]; then \
896 (cd $$d ; $(MAKE) -f Makefile.in proto-dir) ; \
900 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
901 rm -rf proto-toplev; mkdir proto-toplev
902 for d in .. $(PROTODIRS) ; do \
903 if [ $$d != .. ]; then \
904 if [ -d $$d ]; then \
905 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
909 (cd proto-toplev; for i in $(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES); do \
910 if [ ! -d $$i ]; then ln -s ../$$i . ; else true ; fi ; \
912 mkdir proto-toplev/etc
913 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
914 ln -s ../../etc/$$i . ; \
916 # Put only one copy (four hard links) of COPYING in the tar file.
919 # Take out texinfo and glob from configurable dirs
920 rm proto-toplev/configure.in
921 sed -e '/^host_tools=/s/texinfo //' \
922 -e '/^host_libs=/s/glob //' \
923 <configure.in >proto-toplev/configure.in
925 # Take out texinfo from a few places; make simple BISON=bison line.
926 rm proto-toplev/Makefile.in
927 sed -e '/^all\.normal: /s/\all-texinfo //' \
928 -e '/^ install-texinfo /d' \
929 -e '/^BISON = /,/^$$/d' \
930 -e '/^# BISON:/s/.*/BISON = bison -y/' \
931 <Makefile.in >proto-toplev/Makefile.in
933 mkdir proto-toplev/texinfo
934 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
935 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
936 chmod og=u `find proto-toplev -print`
937 (VER=`sed <$(TOOL)/Makefile.in -n 's/VERSION *= *//p'`; \
938 echo "==> Making $(TOOL)-$$VER.tar.z"; \
939 ln -s proto-toplev $(TOOL)-$$VER; \
940 tar cfh - $(TOOL)-$$VER \
941 | $(GZIP) -v >$(TOOL)-$$VER.tar.z)
943 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
946 gas.tar.z: $(DEVO_SUPPORT) $(GAS_SUPPORT_DIRS) gas texinfo/texinfo.tex
947 $(MAKE) -f Makefile.in setup-dirs SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
948 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
954 # start-sanitize-chill
955 ## This is ugly, but I don't want GNU make to put these variables in
956 ## the environment. Older makes will see this as a set of targets
957 ## with no dependencies and no actions.
958 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :