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
49 INSTALL = $${srcroot}/install.sh -c
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL) -m 644
52 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
54 INSTALL_DOSREL = install-dosrel-fake
61 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
62 # here so that they can be overridden by Makefile fragments.
63 HOST_CC = $(CC_FOR_BUILD)
65 HOST_PREFIX_1 = loser-
67 # We don't specify -g -O because many compilers don't support -g -O,
68 # and/or -O is broken in and of itself.
71 CFLAGS_FOR_TARGET = $(CFLAGS)
72 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
76 # start-sanitize-chill
77 CHILLFLAGS = $(CFLAGS)
82 # Use -O2 to stress test the compiler.
84 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
85 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
86 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
90 # Not plain GZIP, since gzip looks there for extra command-line options.
93 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
94 BISON = `if [ -f $$r/byacc/byacc ] ; \
95 then echo $$r/byacc/byacc ; \
99 LEX = `if [ -f $$r/flex/flex ] ; \
100 then echo $$r/flex/flex ; \
103 M4 = `if [ -f $$r/m4/m4 ] ; \
104 then echo $$r/m4/m4 ; \
107 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
108 then echo $$r/texinfo/makeinfo/makeinfo ; \
109 else echo makeinfo ; fi`
111 # This just becomes part of the MAKEINFO definition passed down to
112 # sub-makes. It lets flags be given on the command line while still
113 # using the makeinfo from the object tree.
116 EXPECT = `if [ -f $$r/expect/expect ] ; \
117 then echo $$r/expect/expect ; \
118 else echo expect ; fi`
120 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
121 then echo $${srcroot}/dejagnu/runtest ; \
122 else echo runtest ; fi`
125 # libraries that may need to be augmented on a system-by-system basis
128 # compilers to use to create programs which must be run in the build
131 CXX_FOR_BUILD = $(CXX)
133 SUBDIRS = "this is set via configure, don't edit this"
137 INSTALL_TARGET = install-dirs \
139 $(INSTALL_TARGET_MODULES) \
140 $(INSTALL_X11_MODULES) \
146 if [ -f $$r/gcc/Makefile ] ; then \
147 if [ -f $$r/newlib/Makefile ] ; then \
148 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
150 echo $$r/gcc/xgcc -B$$r/gcc/; \
153 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
156 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
160 # start-sanitize-chill
161 CHILL_FOR_TARGET = ` \
162 if [ -f $$r/gcc/Makefile ] ; then \
163 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
165 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
168 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
175 if [ -f $$r/gcc/Makefile ] ; then \
176 if [ -f $$r/newlib/Makefile ] ; then \
177 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
179 echo $$r/gcc/xgcc -B$$r/gcc/; \
182 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
185 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
190 if [ -f $$r/gas/as.new ] ; then \
191 echo $$r/gas/as.new ; \
193 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
196 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
200 DLLTOOL_FOR_TARGET = ` \
201 if [ -f $$r/binutils/dlltool ] ; then \
202 echo $$r/binutils/dlltool ; \
204 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
207 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
212 if [ -f $$r/binutils/ar ] ; then \
213 echo $$r/binutils/ar ; \
215 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
218 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
222 RANLIB_FOR_TARGET = ` \
223 if [ -f $$r/binutils/ranlib ] ; then \
224 echo $$r/binutils/ranlib ; \
226 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
229 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
234 if [ -f $$r/binutils/nm.new ] ; then \
235 echo $$r/binutils/nm.new ; \
237 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
240 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
244 #### host and target specific makefile fragments come in here.
247 # Flags to pass down to all sub-makes.
248 # Please keep these in alphabetical order.
249 BASE_FLAGS_TO_PASS = \
250 "AR_FLAGS=$(AR_FLAGS)" \
251 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
252 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
254 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
255 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
257 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
258 $(start-sanitize-chill)\
259 "CHILLFLAGS=$(CHILLFLAGS)" \
260 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
261 "CHILL_LIB=$(CHILL_LIB)" \
262 $(end-sanitize-chill)\
263 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
264 "CXXFLAGS=$(CXXFLAGS)" \
265 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
266 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
267 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
268 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
269 "INSTALL=$(INSTALL)" \
270 "INSTALL_DATA=$(INSTALL_DATA)" \
271 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
272 "INSTALL_XFORM=$(INSTALL_XFORM)" \
273 "LDFLAGS=$(LDFLAGS)" \
275 "LIBCFLAGS=$(LIBCFLAGS)" \
276 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
277 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
278 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
280 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
281 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
282 "PICFLAG=$(PICFLAG)" \
283 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
284 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
287 "RUNTEST=$(RUNTEST)" \
288 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
290 "exec_prefix=$(exec_prefix)" \
294 # Flags to pass down to most sub-makes, in which we're building with
295 # the host environment.
296 # If any variables are added here, they must be added to do-*, below.
305 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
307 # Flags that are concerned with the location of the X11 include files
309 X11_FLAGS_TO_PASS = \
310 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
311 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
314 # Flags to pass down to makes which are built with the target environment.
315 # The double $ decreases the length of the command line; the variables
316 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
317 # If any variables are added here, they must be added to do-*, below.
318 EXTRA_TARGET_FLAGS = \
319 'AR=$$(AR_FOR_TARGET)' \
320 'AS=$$(AS_FOR_TARGET)' \
321 'CC=$$(CC_FOR_TARGET)' \
322 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
323 'CXX=$$(CXX_FOR_TARGET)' \
324 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
325 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
326 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
327 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
328 'NM=$$(NM_FOR_TARGET)' \
329 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
330 'RANLIB=$$(RANLIB_FOR_TARGET)'
332 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
334 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
335 # unfortunately needs the native compiler and the target ar and
337 # If any variables are added here, they must be added to do-*, below.
338 # The HOST_* variables are a special case, which are used for the gcc
339 # cross-building scheme.
341 'AR=$$(AR_FOR_TARGET)' \
345 'HOST_CC=$(CC_FOR_BUILD)' \
346 'HOST_PREFIX=$(HOST_PREFIX)' \
347 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
349 'RANLIB=$$(RANLIB_FOR_TARGET)'
351 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
353 # This is a list of the targets for all of the modules which are compiled
354 # using $(FLAGS_TO_PASS).
401 # This is a list of the check targets for all of the modules which are
402 # compiled using $(FLAGS_TO_PASS).
403 # This is a list of the check targets for all of the modules which are
404 # compiled using $(FLAGS_TO_PASS).
406 # The list is in two parts. The first lists those tools which
407 # are tested as part of the host's native tool-chain, and not
408 # tested in a cross configuration.
409 NATIVE_CHECK_MODULES = \
413 CROSS_CHECK_MODULES = \
455 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
457 # This is a list of the install targets for all of the modules which are
458 # compiled using $(FLAGS_TO_PASS).
504 # This is a list of the targets for all of the modules which are compiled
505 # using $(X11_FLAGS_TO_PASS).
515 # This is a list of the check targets for all of the modules which are
516 # compiled using $(X11_FLAGS_TO_PASS).
517 CHECK_X11_MODULES = \
525 # This is a list of the install targets for all the modules which are
526 # compiled using $(X11_FLAGS_TO_PASS).
527 INSTALL_X11_MODULES = \
536 # This is a list of the targets for all of the modules which are compiled
537 # using $(TARGET_FLAGS_TO_PASS).
538 ALL_TARGET_MODULES = \
539 $(start-sanitize-chill) \
541 $(end-sanitize-chill) \
550 # This is a list of the check targets for all of the modules which are
551 # compiled using $(TARGET_FLAGS_TO_PASS).
552 CHECK_TARGET_MODULES = \
553 $(start-sanitize-chill) \
555 $(end-sanitize-chill) \
562 # This is a list of the install targets for all of the modules which are
563 # compiled using $(TARGET_FLAGS_TO_PASS).
564 INSTALL_TARGET_MODULES = \
565 $(start-sanitize-chill) \
567 $(end-sanitize-chill) \
575 # This is a shell case of all modules which are compiled using
576 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
577 TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty
578 # start-sanitize-chill
579 TARGET_LIBS = chillrt | libio | libstdc++ | librx | libg++ | newlib | xiberty
582 # The first rule in the file had better be this one. Don't put any above it.
586 # The target built for a native build.
590 $(ALL_TARGET_MODULES) \
594 # Do a target for all the subdirectories. A ``make do-X'' will do a
595 # ``make X'' in all subdirectories (because, in general, there is a
596 # dependency (below) of X upon do-X, a ``make X'' will also do this,
597 # but it may do additional work as well).
598 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
599 # because it is so large that it can easily overflow the command line
600 # length limit on some systems.
613 @target=`echo $@ | sed -e 's/^do-//'`; \
615 srcroot=`cd $(srcdir); pwd`; export srcroot; \
616 for i in $(SUBDIRS); do \
617 if [ -f ./$$i/Makefile ]; then \
620 for flag in $(EXTRA_TARGET_FLAGS); do \
621 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
625 for flag in $(EXTRA_GCC_FLAGS); do \
626 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
630 for flag in $(EXTRA_HOST_FLAGS); do \
631 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
635 export AR AS CC CXX NM RANLIB; \
637 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
638 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
639 "RANLIB=$${RANLIB}" \
641 then true; else exit 1; fi; \
645 # Here are the targets which correspond to the do-X targets.
647 .PHONY: info installcheck dvi install-info
648 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
650 installcheck: do-installcheck
653 install-info: do-install-info dir.info
654 srcroot=`cd $(srcdir); pwd`; export srcroot; \
655 if [ -f dir.info ] ; then \
656 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
660 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
663 -rm -f Makefile config.status
665 clean: do-clean local-clean
666 mostlyclean: do-mostlyclean local-clean
667 distclean: do-distclean local-clean local-distclean
668 realclean: do-realclean local-clean local-distclean
673 check: $(CHECK_MODULES) \
674 $(CHECK_TARGET_MODULES) \
675 $(CHECK_X11_MODULES) \
678 # Installation targets.
680 .PHONY: install uninstall source-vault binary-vault vault-install
681 install: $(INSTALL_TARGET)
684 @echo "the uninstall target is not supported in this tree"
687 $(MAKE) -f ./release/Build-A-Release \
688 host=$(host_alias) source-vault
691 $(MAKE) -f ./release/Build-A-Release \
692 host=$(host_alias) target=$(target_alias)
695 @if [ -f ./release/vault-install ] ; then \
696 ./release/vault-install $(host_alias) $(target_alias) ; \
702 install.all: install-no-fixedincludes
703 @if [ -f ./gcc/Makefile ] ; then \
704 r=`pwd` ; export r ; \
706 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
711 # install-no-fixedincludes is used because Cygnus can not distribute
712 # the fixed header files.
713 .PHONY: install-no-fixedincludes
714 install-no-fixedincludes: \
717 $(INSTALL_TARGET_MODULES) \
718 $(INSTALL_X11_MODULES) \
721 # Install the gcc headers files, but not the fixed include files,
722 # which Cygnus is not allowed to distribute. This rule is very
723 # dependent on the workings of the gcc Makefile.in.
724 .PHONY: gcc-no-fixedincludes
725 gcc-no-fixedincludes:
726 @if [ -f ./gcc/Makefile ]; then \
727 rm -rf gcc/tmp-include; \
728 mv gcc/include gcc/tmp-include 2>/dev/null; \
730 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
731 touch gcc/stmp-fixinc gcc/include/fixed; \
732 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
734 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
736 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
737 rm -rf gcc/include; \
738 mv gcc/tmp-include gcc/include 2>/dev/null; \
741 # This rule is used to build the modules which use FLAGS_TO_PASS. To
742 # build a target all-X means to cd to X and make all.
744 # all-gui, and all-libproc are handled specially because
745 # they are still experimental, and if they fail to build, that
746 # shouldn't stop "make all".
747 .PHONY: $(ALL_MODULES) all-gui all-libproc
748 $(ALL_MODULES) all-gui all-libproc:
749 @dir=`echo $@ | sed -e 's/all-//'`; \
750 if [ -f ./$${dir}/Makefile ] ; then \
752 srcroot=`cd $(srcdir); pwd`; export srcroot; \
753 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
758 # These rules are used to check the modules which use FLAGS_TO_PASS.
759 # To build a target check-X means to cd to X and make check. Some
760 # modules are only tested in a native toolchain.
762 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
763 $(NATIVE_CHECK_MODULES):
764 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
765 dir=`echo $@ | sed -e 's/check-//'`; \
766 if [ -f ./$${dir}/Makefile ] ; then \
768 srcroot=`cd $(srcdir); pwd`; export srcroot; \
769 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
775 $(CROSS_CHECK_MODULES):
776 @dir=`echo $@ | sed -e 's/check-//'`; \
777 if [ -f ./$${dir}/Makefile ] ; then \
779 srcroot=`cd $(srcdir); pwd`; export srcroot; \
780 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
785 # This rule is used to install the modules which use FLAGS_TO_PASS.
786 # To build a target install-X means to cd to X and make install.
787 .PHONY: $(INSTALL_MODULES)
788 $(INSTALL_MODULES): install-dirs
789 @dir=`echo $@ | sed -e 's/install-//'`; \
790 if [ -f ./$${dir}/Makefile ] ; then \
792 srcroot=`cd $(srcdir); pwd`; export srcroot; \
793 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
798 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
799 # To build a target all-X means to cd to X and make all.
800 .PHONY: $(ALL_TARGET_MODULES)
801 $(ALL_TARGET_MODULES):
802 @dir=`echo $@ | sed -e 's/all-//'`; \
803 if [ -f ./$${dir}/Makefile ] ; then \
805 srcroot=`cd $(srcdir); pwd`; export srcroot; \
806 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
811 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
812 # To build a target install-X means to cd to X and make install.
813 .PHONY: $(CHECK_TARGET_MODULES)
814 $(CHECK_TARGET_MODULES):
815 @dir=`echo $@ | sed -e 's/check-//'`; \
816 if [ -f ./$${dir}/Makefile ] ; then \
818 srcroot=`cd $(srcdir); pwd`; export srcroot; \
819 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
824 # This rule is used to install the modules which use
825 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
827 .PHONY: $(INSTALL_TARGET_MODULES)
828 $(INSTALL_TARGET_MODULES): install-dirs
829 @dir=`echo $@ | sed -e 's/install-//'`; \
830 if [ -f ./$${dir}/Makefile ] ; then \
832 srcroot=`cd $(srcdir); pwd`; export srcroot; \
833 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
838 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
839 # To build a target all-X means to cd to X and make all.
840 .PHONY: $(ALL_X11_MODULES)
842 @dir=`echo $@ | sed -e 's/all-//'`; \
843 if [ -f ./$${dir}/Makefile ] ; then \
845 srcroot=`cd $(srcdir); pwd`; export srcroot; \
847 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
852 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
853 # To build a target check-X means to cd to X and make all.
854 .PHONY: $(CHECK_X11_MODULES)
855 $(CHECK_X11_MODULES):
856 @dir=`echo $@ | sed -e 's/check-//'`; \
857 if [ -f ./$${dir}/Makefile ] ; then \
859 srcroot=`cd $(srcdir); pwd`; export srcroot; \
861 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
866 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
867 # To build a target install-X means to cd to X and make install.
868 .PHONY: $(INSTALL_X11_MODULES)
869 $(INSTALL_X11_MODULES):
870 @dir=`echo $@ | sed -e 's/install-//'`; \
871 if [ -f ./$${dir}/Makefile ] ; then \
873 srcroot=`cd $(srcdir); pwd`; export srcroot; \
875 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
880 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
883 @if [ -f ./gcc/Makefile ] ; then \
885 srcroot=`cd $(srcdir); pwd`; export srcroot; \
886 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
893 @if [ -f ./gcc/Makefile ] ; then \
895 srcroot=`cd $(srcdir); pwd`; export srcroot; \
896 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
903 @if [ -f ./gcc/Makefile ] ; then \
905 srcroot=`cd $(srcdir); pwd`; export srcroot; \
906 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
913 # This rule is used to install the modules which use FLAGS_TO_PASS.
914 # To build a target install-X means to cd to X and make install.
915 .PHONY: install-dosrel
916 install-dosrel: install-dirs info
917 @dir=`echo $@ | sed -e 's/install-//'`; \
918 if [ -f ./$${dir}/Makefile ] ; then \
920 srcroot=`cd $(srcdir); pwd`; export srcroot; \
921 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
929 # This is a list of inter-dependencies among modules.
932 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
934 # start-sanitize-chill
935 all-chillrt: all-binutils all-gas all-gcc all-newlib
938 all-dejagnu: all-tcl all-expect all-tk
939 all-diff: all-libiberty
941 all-emacs19: all-byacc
943 all-expect: all-tcl all-tk
944 all-fileutils: all-libiberty
946 all-flex: all-libiberty all-byacc
947 all-gas: all-libiberty all-opcodes all-bfd
950 all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
951 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements)
952 all-gprof: all-libiberty all-bfd
953 all-grep: all-libiberty
954 all-gui: all-gdb all-libproc all-librx
955 all-gzip: all-libiberty
956 all-hello: all-libiberty
958 all-ispell: all-emacs19
959 all-ld: all-libiberty all-bfd all-byacc all-flex
960 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
961 all-libio: all-gas all-ld all-gcc all-xiberty all-newlib
963 all-libstdc++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio
964 all-m4: all-libiberty
965 all-make: all-libiberty
967 all-newlib: all-binutils all-gas all-gcc
970 all-prms: all-libiberty
973 all-recode: all-libiberty
974 all-sed: all-libiberty
975 all-send-pr: all-prms
977 all-sim: all-libiberty all-bfd
978 all-tar: all-libiberty
980 all-tclX: all-tcl all-tk
982 all-texinfo: all-libiberty
984 all-tgas: all-libiberty all-bfd
987 all-uudecode: all-libiberty
988 all-xiberty: all-gcc all-ld all-newlib
990 ### other supporting targets
999 @for i in $(MAKEDIRS) ; do \
1000 echo Making $$i... ; \
1001 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
1002 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1003 if [ ! -d $$i ] ; then \
1004 if mkdir $$i ; then \
1015 dir.info: do-install-info
1016 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1017 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1018 mv -f dir.info.new dir.info ; \
1023 @echo "Building a full distribution of this tree isn't done"
1024 @echo "via 'make dist'. Check out the etc/ subdirectory"
1028 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1029 # ability to use several tags files at once, so there is probably no need
1030 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1031 # (if we felt like it) have this Makefile write a piece of elisp which
1032 # the user could load to tell emacs19 where all the TAGS files we just
1036 # with the gnu make, this is done automatically.
1038 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1039 $(SHELL) ./config.status
1042 # Support for building net releases
1044 # Files in devo used in any net release.
1045 # ChangeLog omitted because it may refer to files which are not in this
1046 # distribution (perhaps it would be better to include it anyway).
1047 DEVO_SUPPORT= README Makefile.in configure configure.in \
1048 config.guess config.sub config move-if-change \
1049 COPYING COPYING.LIB install.sh
1051 # Files in devo/etc used in any net release.
1052 # ChangeLog omitted because it may refer to files which are not in this
1053 # distribution (perhaps it would be better to include it anyway).
1054 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
1055 configure.texi standards.texi make-stds.texi
1056 ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
1058 # When you use `make setup-dirs' or `make taz' you should always redefine
1060 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1061 # Directories that might want `make diststuff' run.
1062 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
1063 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1064 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1065 # Directories where "info" should be built.
1066 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
1070 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1071 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1072 # Make sure "diststuff" files get built properly.
1073 for f in $(DISTBISONFILES) ; do \
1074 if [ -r $$f ]; then \
1075 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1079 # Take out texinfo from a few places; make simple BISON=bison line.
1080 sed -e '/^all\.normal: /s/\all-texinfo //' \
1081 -e '/^ install-texinfo /d' \
1082 -e '/^BISON = /,/^$$/d' \
1083 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1085 mv -f tmp Makefile.in
1087 $(start-sanitize-Sanitize)
1088 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1089 $(end-sanitize-Sanitize)
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 (cd $$d ; $(MAKE) diststuff ) || exit 1 ;; \
1110 if [ -d $$d/proto-$$d.dir ]; then \
1111 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1113 ln -s ../$$d proto-toplev/$$d ; \
1115 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1119 mkdir proto-toplev/etc
1120 (cd proto-toplev/etc; \
1121 for i in $(ETC_SUPPORT); do \
1122 ln -s ../../etc/$$i . ; \
1124 for i in $(ETC_SUPPORT_PFX); do \
1125 ln -s ../../etc/$$i* . ; \
1128 # Take out texinfo from configurable dirs
1129 rm proto-toplev/configure.in
1130 sed -e '/^host_tools=/s/texinfo //' \
1131 <configure.in >proto-toplev/configure.in
1133 mkdir proto-toplev/texinfo
1134 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1135 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1136 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1137 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1138 chmod og=u `find . -print`
1139 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1140 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1141 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1142 tar cfh - $(TOOL)-$$VER \
1143 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1145 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1146 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1149 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1150 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1151 $(MAKE) -f Makefile.in taz TOOL=gas \
1152 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1154 # The FSF "binutils" release includes gprof and ld.
1155 .PHONY: binutils.tar.gz
1156 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
1157 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1158 $(MAKE) -f Makefile.in taz TOOL=binutils \
1159 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1161 .PHONY: gas+binutils.tar.gz
1162 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1163 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1164 $(MAKE) -f Makefile.in taz TOOL=gas \
1165 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1167 .PHONY: libg++.tar.gz
1168 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty xiberty
1169 libg++.tar.gz: $(DIST_SUPPORT) libg++
1170 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1171 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1173 GNATS_SUPPORT_DIRS=include libiberty send-pr
1174 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1175 $(MAKE) -f Makefile.in taz TOOL=gnats \
1176 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1179 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim
1180 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1181 $(MAKE) -f Makefile.in taz TOOL=gdb \
1182 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1184 .PHONY: newlib.tar.gz
1185 NEWLIB_SUPPORT_DIRS=libgloss
1186 # taz configures for the sun4 target which won't configure newlib.
1187 # We need newlib configured so that the .info files are made.
1188 # Unfortunately, it is not enough to just configure newlib separately:
1189 # taz will build the .info files but since SUBDIRS won't contain newlib,
1190 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1191 # used in building the .info files, eg: *.def, *.ref).
1192 # Compensate here by configuring newlib for a simple (no multilib support)
1193 # cross target (sparc64), building the info files, and doing make distclean
1195 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1197 cd newlib && ../configure --srcdir $$rootme/newlib \
1198 --host sun4 --target sparc64-elf
1199 cd newlib ; make info
1200 cd newlib ; make distclean
1201 $(MAKE) -f Makefile.in taz TOOL=newlib \
1202 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1203 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
1204 DISTDOCDIRS="$(DISTDOCDIRS) newlib"
1209 # start-sanitize-chill
1210 ## This is ugly, but I don't want GNU make to put these variables in
1211 ## the environment. Older makes will see this as a set of targets
1212 ## with no dependencies and no actions.
1213 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1214 # end-sanitize-chill
1216 # end of Makefile.in