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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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"
136 # This is set by the configure script to the list of directories which
137 # should be built using the target tools.
138 TARGET_CONFIGDIRS = xiberty libgloss newlib libio librx libstdc++ libg++ winsup
140 # This is set by the configure script to the arguments passed to configure.
144 INSTALL_TARGET = install-dirs \
146 $(INSTALL_TARGET_MODULES) \
147 $(INSTALL_X11_MODULES) \
153 if [ -f $$r/gcc/Makefile ] ; then \
154 if [ -f $$r/newlib/Makefile ] ; then \
155 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
157 echo $$r/gcc/xgcc -B$$r/gcc/; \
160 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
163 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
167 # start-sanitize-chill
168 CHILL_FOR_TARGET = ` \
169 if [ -f $$r/gcc/Makefile ] ; then \
170 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
172 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
175 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
182 if [ -f $$r/gcc/Makefile ] ; then \
183 if [ -f $$r/newlib/Makefile ] ; then \
184 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
186 echo $$r/gcc/xgcc -B$$r/gcc/; \
189 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
192 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
197 if [ -f $$r/gas/as.new ] ; then \
198 echo $$r/gas/as.new ; \
200 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
203 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
207 DLLTOOL_FOR_TARGET = ` \
208 if [ -f $$r/binutils/dlltool ] ; then \
209 echo $$r/binutils/dlltool ; \
211 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
214 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
219 if [ -f $$r/binutils/ar ] ; then \
220 echo $$r/binutils/ar ; \
222 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
225 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
229 RANLIB_FOR_TARGET = ` \
230 if [ -f $$r/binutils/ranlib ] ; then \
231 echo $$r/binutils/ranlib ; \
233 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
236 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
241 if [ -f $$r/binutils/nm.new ] ; then \
242 echo $$r/binutils/nm.new ; \
244 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
247 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
251 #### host and target specific makefile fragments come in here.
254 # Flags to pass down to all sub-makes.
255 # Please keep these in alphabetical order.
256 BASE_FLAGS_TO_PASS = \
257 "AR_FLAGS=$(AR_FLAGS)" \
258 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
259 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
261 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
262 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
264 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
265 $(start-sanitize-chill)\
266 "CHILLFLAGS=$(CHILLFLAGS)" \
267 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
268 "CHILL_LIB=$(CHILL_LIB)" \
269 $(end-sanitize-chill)\
270 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
271 "CXXFLAGS=$(CXXFLAGS)" \
272 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
273 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
274 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
275 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
276 "INSTALL=$(INSTALL)" \
277 "INSTALL_DATA=$(INSTALL_DATA)" \
278 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
279 "INSTALL_XFORM=$(INSTALL_XFORM)" \
280 "LDFLAGS=$(LDFLAGS)" \
282 "LIBCFLAGS=$(LIBCFLAGS)" \
283 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
284 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
285 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
287 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
288 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
289 "PICFLAG=$(PICFLAG)" \
290 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
291 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
294 "RUNTEST=$(RUNTEST)" \
295 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
297 "exec_prefix=$(exec_prefix)" \
301 # Flags to pass down to most sub-makes, in which we're building with
302 # the host environment.
303 # If any variables are added here, they must be added to do-*, below.
312 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
314 # Flags that are concerned with the location of the X11 include files
316 X11_FLAGS_TO_PASS = \
317 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
318 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
321 # Flags to pass down to makes which are built with the target environment.
322 # The double $ decreases the length of the command line; the variables
323 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
324 # If any variables are added here, they must be added to do-*, below.
325 EXTRA_TARGET_FLAGS = \
326 'AR=$$(AR_FOR_TARGET)' \
327 'AS=$$(AS_FOR_TARGET)' \
328 'CC=$$(CC_FOR_TARGET)' \
329 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
330 'CXX=$$(CXX_FOR_TARGET)' \
331 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
332 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
333 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
334 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
335 'NM=$$(NM_FOR_TARGET)' \
336 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
337 'RANLIB=$$(RANLIB_FOR_TARGET)'
339 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
341 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
342 # unfortunately needs the native compiler and the target ar and
344 # If any variables are added here, they must be added to do-*, below.
345 # The HOST_* variables are a special case, which are used for the gcc
346 # cross-building scheme.
348 'AR=$$(AR_FOR_TARGET)' \
352 'HOST_CC=$(CC_FOR_BUILD)' \
353 'HOST_PREFIX=$(HOST_PREFIX)' \
354 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
356 'RANLIB=$$(RANLIB_FOR_TARGET)'
358 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
360 # This is a list of the targets for all of the modules which are compiled
361 # using $(FLAGS_TO_PASS).
408 # This is a list of the check targets for all of the modules which are
409 # compiled using $(FLAGS_TO_PASS).
410 # This is a list of the check targets for all of the modules which are
411 # compiled using $(FLAGS_TO_PASS).
413 # The list is in two parts. The first lists those tools which
414 # are tested as part of the host's native tool-chain, and not
415 # tested in a cross configuration.
416 NATIVE_CHECK_MODULES = \
420 CROSS_CHECK_MODULES = \
462 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
464 # This is a list of the install targets for all of the modules which are
465 # compiled using $(FLAGS_TO_PASS).
511 # This is a list of the targets for all of the modules which are compiled
512 # using $(X11_FLAGS_TO_PASS).
522 # This is a list of the check targets for all of the modules which are
523 # compiled using $(X11_FLAGS_TO_PASS).
524 CHECK_X11_MODULES = \
532 # This is a list of the install targets for all the modules which are
533 # compiled using $(X11_FLAGS_TO_PASS).
534 INSTALL_X11_MODULES = \
543 # This is a list of the targets for all of the modules which are compiled
544 # using $(TARGET_FLAGS_TO_PASS).
545 ALL_TARGET_MODULES = \
555 # This is a list of the configure targets for all of the modules which
556 # are compiled using the target tools.
557 CONFIGURE_TARGET_MODULES = \
559 configure-libstdc++ \
567 # This is a list of the check targets for all of the modules which are
568 # compiled using $(TARGET_FLAGS_TO_PASS).
569 CHECK_TARGET_MODULES = \
577 # This is a list of the install targets for all of the modules which are
578 # compiled using $(TARGET_FLAGS_TO_PASS).
579 INSTALL_TARGET_MODULES = \
588 # This is a shell case of all modules which are compiled using
589 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
590 TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty | winsup
592 # The first rule in the file had better be this one. Don't put any above it.
596 # The target built for a native build.
600 $(ALL_TARGET_MODULES) \
604 # Do a target for all the subdirectories. A ``make do-X'' will do a
605 # ``make X'' in all subdirectories (because, in general, there is a
606 # dependency (below) of X upon do-X, a ``make X'' will also do this,
607 # but it may do additional work as well).
608 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
609 # because it is so large that it can easily overflow the command line
610 # length limit on some systems.
619 do-maintainer-clean \
623 @target=`echo $@ | sed -e 's/^do-//'`; \
625 srcroot=`cd $(srcdir); pwd`; export srcroot; \
626 for i in $(SUBDIRS) $(TARGET_CONFIGDIRS); do \
627 if [ -f ./$$i/Makefile ]; then \
630 for flag in $(EXTRA_TARGET_FLAGS); do \
631 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
635 for flag in $(EXTRA_GCC_FLAGS); do \
636 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
640 for flag in $(EXTRA_HOST_FLAGS); do \
641 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
645 export AR AS CC CXX NM RANLIB; \
647 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
648 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
649 "RANLIB=$${RANLIB}" \
651 then true; else exit 1; fi; \
655 # Here are the targets which correspond to the do-X targets.
657 .PHONY: info installcheck dvi install-info
658 .PHONY: clean distclean mostlyclean maintainer-clean realclean
659 .PHONY: local-clean local-distclean local-maintainer-clean
661 installcheck: do-installcheck
664 install-info: do-install-info dir.info
665 srcroot=`cd $(srcdir); pwd`; export srcroot; \
666 if [ -f dir.info ] ; then \
667 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
671 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
674 -rm -f Makefile config.status
676 local-maintainer-clean:
677 @echo "This command is intended for maintainers to use;"
678 @echo "it deletes files that may require special tools to rebuild."
680 clean: do-clean local-clean
681 mostlyclean: do-mostlyclean local-clean
682 distclean: do-distclean local-clean local-distclean
683 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
684 maintainer-clean: local-distclean
685 realclean: maintainer-clean
690 check: $(CHECK_MODULES) \
691 $(CHECK_TARGET_MODULES) \
692 $(CHECK_X11_MODULES) \
695 # Installation targets.
697 .PHONY: install uninstall source-vault binary-vault vault-install
698 install: $(INSTALL_TARGET)
701 @echo "the uninstall target is not supported in this tree"
704 $(MAKE) -f ./release/Build-A-Release \
705 host=$(host_alias) source-vault
708 $(MAKE) -f ./release/Build-A-Release \
709 host=$(host_alias) target=$(target_alias)
712 @if [ -f ./release/vault-install ] ; then \
713 ./release/vault-install $(host_alias) $(target_alias) ; \
719 install.all: install-no-fixedincludes
720 @if [ -f ./gcc/Makefile ] ; then \
721 r=`pwd` ; export r ; \
723 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
728 # install-no-fixedincludes is used because Cygnus can not distribute
729 # the fixed header files.
730 .PHONY: install-no-fixedincludes
731 install-no-fixedincludes: \
734 $(INSTALL_TARGET_MODULES) \
735 $(INSTALL_X11_MODULES) \
738 # Install the gcc headers files, but not the fixed include files,
739 # which Cygnus is not allowed to distribute. This rule is very
740 # dependent on the workings of the gcc Makefile.in.
741 .PHONY: gcc-no-fixedincludes
742 gcc-no-fixedincludes:
743 @if [ -f ./gcc/Makefile ]; then \
744 rm -rf gcc/tmp-include; \
745 mv gcc/include gcc/tmp-include 2>/dev/null; \
747 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
748 touch gcc/stmp-fixinc gcc/include/fixed; \
749 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
751 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
753 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
754 rm -rf gcc/include; \
755 mv gcc/tmp-include gcc/include 2>/dev/null; \
758 # This rule is used to build the modules which use FLAGS_TO_PASS. To
759 # build a target all-X means to cd to X and make all.
761 # all-gui, and all-libproc are handled specially because
762 # they are still experimental, and if they fail to build, that
763 # shouldn't stop "make all".
764 .PHONY: $(ALL_MODULES) all-gui all-libproc
765 $(ALL_MODULES) all-gui all-libproc:
766 @dir=`echo $@ | sed -e 's/all-//'`; \
767 if [ -f ./$${dir}/Makefile ] ; then \
769 srcroot=`cd $(srcdir); pwd`; export srcroot; \
770 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
775 # These rules are used to check the modules which use FLAGS_TO_PASS.
776 # To build a target check-X means to cd to X and make check. Some
777 # modules are only tested in a native toolchain.
779 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
780 $(NATIVE_CHECK_MODULES):
781 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
782 dir=`echo $@ | sed -e 's/check-//'`; \
783 if [ -f ./$${dir}/Makefile ] ; then \
785 srcroot=`cd $(srcdir); pwd`; export srcroot; \
786 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
792 $(CROSS_CHECK_MODULES):
793 @dir=`echo $@ | sed -e 's/check-//'`; \
794 if [ -f ./$${dir}/Makefile ] ; then \
796 srcroot=`cd $(srcdir); pwd`; export srcroot; \
797 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
802 # This rule is used to install the modules which use FLAGS_TO_PASS.
803 # To build a target install-X means to cd to X and make install.
804 .PHONY: $(INSTALL_MODULES)
805 $(INSTALL_MODULES): install-dirs
806 @dir=`echo $@ | sed -e 's/install-//'`; \
807 if [ -f ./$${dir}/Makefile ] ; then \
809 srcroot=`cd $(srcdir); pwd`; export srcroot; \
810 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
815 # This rule is used to configure the modules which are built with the
817 .PHONY: $(CONFIGURE_TARGET_MODULES)
818 $(CONFIGURE_TARGET_MODULES):
819 @dir=`echo $@ | sed -e 's/configure-//'`; \
820 if [ -f ./$${dir}/Makefile ] ; then \
822 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
823 if [ -d $(srcdir)/$${dir} ]; then \
824 if [ -d ./$${dir} ]; then true; else mkdir $${dir}; fi; \
826 srcroot=`cd $(srcdir); pwd`; export srcroot; \
827 AR="$(AR_FOR_TARGET)"; export AR; \
828 AS="$(AS_FOR_TARGET)"; export AS; \
829 CC="$(CC_FOR_TARGET)"; export CC; \
830 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
831 CXX="$(CXX_FOR_TARGET)"; export CXX; \
832 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
833 NM="$(NM_FOR_TARGET)"; export NM; \
834 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
836 $${srcroot}/configure $(CONFIG_ARGUMENTS) --srcdir=$${srcroot}/$${dir}; \
844 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
845 # To build a target all-X means to cd to X and make all.
846 .PHONY: $(ALL_TARGET_MODULES)
847 $(ALL_TARGET_MODULES):
848 @dir=`echo $@ | sed -e 's/all-//'`; \
849 if [ -f ./$${dir}/Makefile ] ; then \
851 srcroot=`cd $(srcdir); pwd`; export srcroot; \
852 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
857 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
858 # To build a target install-X means to cd to X and make install.
859 .PHONY: $(CHECK_TARGET_MODULES)
860 $(CHECK_TARGET_MODULES):
861 @dir=`echo $@ | sed -e 's/check-//'`; \
862 if [ -f ./$${dir}/Makefile ] ; then \
864 srcroot=`cd $(srcdir); pwd`; export srcroot; \
865 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
870 # This rule is used to install the modules which use
871 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
873 .PHONY: $(INSTALL_TARGET_MODULES)
874 $(INSTALL_TARGET_MODULES): install-dirs
875 @dir=`echo $@ | sed -e 's/install-//'`; \
876 if [ -f ./$${dir}/Makefile ] ; then \
878 srcroot=`cd $(srcdir); pwd`; export srcroot; \
879 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
884 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
885 # To build a target all-X means to cd to X and make all.
886 .PHONY: $(ALL_X11_MODULES)
888 @dir=`echo $@ | sed -e 's/all-//'`; \
889 if [ -f ./$${dir}/Makefile ] ; then \
891 srcroot=`cd $(srcdir); pwd`; export srcroot; \
893 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
898 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
899 # To build a target check-X means to cd to X and make all.
900 .PHONY: $(CHECK_X11_MODULES)
901 $(CHECK_X11_MODULES):
902 @dir=`echo $@ | sed -e 's/check-//'`; \
903 if [ -f ./$${dir}/Makefile ] ; then \
905 srcroot=`cd $(srcdir); pwd`; export srcroot; \
907 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
912 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
913 # To build a target install-X means to cd to X and make install.
914 .PHONY: $(INSTALL_X11_MODULES)
915 $(INSTALL_X11_MODULES):
916 @dir=`echo $@ | sed -e 's/install-//'`; \
917 if [ -f ./$${dir}/Makefile ] ; then \
919 srcroot=`cd $(srcdir); pwd`; export srcroot; \
921 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
926 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
929 @if [ -f ./gcc/Makefile ] ; then \
931 srcroot=`cd $(srcdir); pwd`; export srcroot; \
932 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
939 @if [ -f ./gcc/Makefile ] ; then \
941 srcroot=`cd $(srcdir); pwd`; export srcroot; \
942 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
949 @if [ -f ./gcc/Makefile ] ; then \
951 srcroot=`cd $(srcdir); pwd`; export srcroot; \
952 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
959 # This rule is used to install the modules which use FLAGS_TO_PASS.
960 # To build a target install-X means to cd to X and make install.
961 .PHONY: install-dosrel
962 install-dosrel: install-dirs info
963 @dir=`echo $@ | sed -e 's/install-//'`; \
964 if [ -f ./$${dir}/Makefile ] ; then \
966 srcroot=`cd $(srcdir); pwd`; export srcroot; \
967 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
975 # This is a list of inter-dependencies among modules.
978 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
981 all-dejagnu: all-tcl all-expect all-tk
982 all-diff: all-libiberty
984 all-emacs19: all-byacc
986 all-expect: all-tcl all-tk
987 all-fileutils: all-libiberty
989 all-flex: all-libiberty all-byacc
990 all-gas: all-libiberty all-opcodes all-bfd
993 all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
994 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements)
995 all-gprof: all-libiberty all-bfd
996 all-grep: all-libiberty
997 all-gui: all-gdb all-libproc all-librx
998 all-gzip: all-libiberty
999 all-hello: all-libiberty
1001 all-ispell: all-emacs19
1002 all-ld: all-libiberty all-bfd all-byacc all-flex
1003 configure-libg++: all-gcc
1004 all-libg++: configure-libg++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
1005 configure-libgloss: all-gcc
1006 all-libgloss: configure-libgloss
1007 configure-libio: all-gcc
1008 all-libio: configure-libio all-gas all-ld all-gcc all-xiberty all-newlib
1010 configure-librx: all-gcc all-newlib
1011 all-librx: configure-librx
1012 configure-libstdc++: all-gcc
1013 all-libstdc++: configure-libstdc++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio
1014 all-m4: all-libiberty
1015 all-make: all-libiberty
1017 configure-newlib: all-gcc
1018 all-newlib: configure-newlib all-binutils all-gas all-gcc
1019 all-opcodes: all-bfd
1021 all-prms: all-libiberty
1024 all-recode: all-libiberty
1025 all-sed: all-libiberty
1026 all-send-pr: all-prms
1028 all-sim: all-libiberty all-bfd
1029 all-tar: all-libiberty
1031 all-tclX: all-tcl all-tk
1033 all-texinfo: all-libiberty
1035 all-tgas: all-libiberty all-bfd
1038 all-winsup: all-newlib
1039 configure-winsup: configure-newlib
1040 all-uudecode: all-libiberty
1041 configure-xiberty: all-gcc
1042 all-xiberty: configure-xiberty all-gcc all-ld all-newlib
1044 ### other supporting targets
1051 .PHONY: install-dirs
1053 @for i in $(MAKEDIRS) ; do \
1054 echo Making $$i... ; \
1055 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
1056 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1057 if [ ! -d $$i ] ; then \
1058 if mkdir $$i ; then \
1069 dir.info: do-install-info
1070 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1071 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1072 mv -f dir.info.new dir.info ; \
1077 @echo "Building a full distribution of this tree isn't done"
1078 @echo "via 'make dist'. Check out the etc/ subdirectory"
1082 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1083 # ability to use several tags files at once, so there is probably no need
1084 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1085 # (if we felt like it) have this Makefile write a piece of elisp which
1086 # the user could load to tell emacs19 where all the TAGS files we just
1090 # with the gnu make, this is done automatically.
1092 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1093 $(SHELL) ./config.status
1096 # Support for building net releases
1098 # Files in devo used in any net release.
1099 # ChangeLog omitted because it may refer to files which are not in this
1100 # distribution (perhaps it would be better to include it anyway).
1101 DEVO_SUPPORT= README Makefile.in configure configure.in \
1102 config.guess config.sub config move-if-change \
1103 mpw-README mpw-build.in mpw-config.in mpw-configure \
1104 COPYING COPYING.LIB install.sh
1106 # Files in devo/etc used in any net release.
1107 # ChangeLog omitted because it may refer to files which are not in this
1108 # distribution (perhaps it would be better to include it anyway).
1109 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
1110 configure.texi standards.texi make-stds.texi
1111 ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
1113 # When you use `make setup-dirs' or `make taz' you should always redefine
1115 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1116 # Directories that might want `make diststuff' run.
1117 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
1118 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1119 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1120 # Directories where "info" should be built.
1121 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
1125 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1126 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1127 # Make sure "diststuff" files get built properly.
1128 for f in $(DISTBISONFILES) ; do \
1129 if [ -r $$f ]; then \
1130 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1134 # Take out texinfo from a few places; make simple BISON=bison line.
1135 sed -e '/^all\.normal: /s/\all-texinfo //' \
1136 -e '/^ install-texinfo /d' \
1137 -e '/^BISON = /,/^$$/d' \
1138 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1140 mv -f tmp Makefile.in
1142 $(start-sanitize-Sanitize)
1143 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1144 $(end-sanitize-Sanitize)
1146 # Doc files don't change; include them in distribution.
1147 for f in $(DISTDOCDIRS) ; do \
1148 if [ -r $$f/Makefile ]; then \
1149 (cd $$f ; $(MAKE) info) || exit 1 ; \
1152 # Make links, and run "make diststuff" when needed.
1153 # The `echo' for setting `p' is to convert all whitespace to spaces.
1154 # Then the `case' further below should tell whether $$d is in
1156 rm -rf proto-toplev ; mkdir proto-toplev
1157 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1158 p=" `echo $(DISTSTUFFDIRS)` " ; \
1159 for d in $$dirs ; do \
1160 if [ -d $$d ]; then \
1163 (cd $$d ; $(MAKE) diststuff ) || exit 1 ;; \
1165 if [ -d $$d/proto-$$d.dir ]; then \
1166 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1168 ln -s ../$$d proto-toplev/$$d ; \
1170 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1174 mkdir proto-toplev/etc
1175 (cd proto-toplev/etc; \
1176 for i in $(ETC_SUPPORT); do \
1177 ln -s ../../etc/$$i . ; \
1179 for i in $(ETC_SUPPORT_PFX); do \
1180 ln -s ../../etc/$$i* . ; \
1183 # Take out texinfo from configurable dirs
1184 rm proto-toplev/configure.in
1185 sed -e '/^host_tools=/s/texinfo //' \
1186 <configure.in >proto-toplev/configure.in
1188 mkdir proto-toplev/texinfo
1189 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1190 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1191 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1192 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1193 chmod og=u `find . -print`
1194 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1195 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1196 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1197 tar cfh - $(TOOL)-$$VER \
1198 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1200 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1201 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1204 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1205 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1206 $(MAKE) -f Makefile.in taz TOOL=gas \
1207 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1209 # The FSF "binutils" release includes gprof and ld.
1210 .PHONY: binutils.tar.gz
1211 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
1212 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1213 $(MAKE) -f Makefile.in taz TOOL=binutils \
1214 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1216 .PHONY: gas+binutils.tar.gz
1217 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1218 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1219 $(MAKE) -f Makefile.in taz TOOL=gas \
1220 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1222 .PHONY: libg++.tar.gz
1223 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty xiberty
1224 libg++.tar.gz: $(DIST_SUPPORT) libg++
1225 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1226 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1228 GNATS_SUPPORT_DIRS=include libiberty send-pr
1229 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1230 $(MAKE) -f Makefile.in taz TOOL=gnats \
1231 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1234 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1235 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1236 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1237 $(MAKE) -f Makefile.in taz TOOL=gdb \
1238 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1240 .PHONY: newlib.tar.gz
1241 NEWLIB_SUPPORT_DIRS=libgloss
1242 # taz configures for the sun4 target which won't configure newlib.
1243 # We need newlib configured so that the .info files are made.
1244 # Unfortunately, it is not enough to just configure newlib separately:
1245 # taz will build the .info files but since SUBDIRS won't contain newlib,
1246 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1247 # used in building the .info files, eg: *.def, *.ref).
1248 # Compensate here by configuring newlib for a simple (no multilib support)
1249 # cross target (sparc64), building the info files, and doing make distclean
1251 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1253 cd newlib && ../configure --srcdir $$rootme/newlib \
1254 --host sun4 --target sparc64-elf
1255 cd newlib ; make info
1256 cd newlib ; make distclean
1257 $(MAKE) -f Makefile.in taz TOOL=newlib \
1258 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1259 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
1260 DISTDOCDIRS="$(DISTDOCDIRS) newlib"
1265 # start-sanitize-chill
1266 ## This is ugly, but I don't want GNU make to put these variables in
1267 ## the environment. Older makes will see this as a set of targets
1268 ## with no dependencies and no actions.
1269 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1270 # end-sanitize-chill
1272 # end of Makefile.in