2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 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)/share
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
48 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
50 INSTALL_PROGRAM_ARGS =
52 INSTALL = $(SHELL) $$s/install-sh -c
53 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
54 INSTALL_SCRIPT = $(INSTALL)
55 INSTALL_DATA = $(INSTALL) -m 644
57 INSTALL_DOSREL = install-dosrel-fake
64 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
65 # here so that they can be overridden by Makefile fragments.
66 HOST_CC = $(CC_FOR_BUILD)
68 HOST_PREFIX_1 = loser-
70 # These flag values are normally overridden by the configure script.
75 CFLAGS_FOR_TARGET = $(CFLAGS)
77 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
83 # 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
97 # Not plain GZIP, since gzip looks there for extra command-line options.
100 # These values are substituted by configure.
105 BISON = `if [ -f $$r/bison/bison ] ; then \
106 echo $$r/bison/bison -L $$s/bison/ ; \
111 YACC = `if [ -f $$r/bison/bison ] ; then \
112 echo $$r/bison/bison -y -L $$s/bison/ ; \
113 elif [ -f $$r/byacc/byacc ] ; then \
114 echo $$r/byacc/byacc ; \
116 echo ${DEFAULT_YACC} ; \
119 LEX = `if [ -f $$r/flex/flex ] ; \
120 then echo $$r/flex/flex ; \
121 else echo ${DEFAULT_LEX} ; fi`
123 M4 = `if [ -f $$r/m4/m4 ] ; \
124 then echo $$r/m4/m4 ; \
125 else echo ${DEFAULT_M4} ; fi`
127 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
128 then echo $$r/texinfo/makeinfo/makeinfo ; \
129 else echo makeinfo ; fi`
131 # This just becomes part of the MAKEINFO definition passed down to
132 # sub-makes. It lets flags be given on the command line while still
133 # using the makeinfo from the object tree.
136 EXPECT = `if [ -f $$r/expect/expect ] ; \
137 then echo $$r/expect/expect ; \
138 else echo expect ; fi`
140 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
141 then echo $$s/dejagnu/runtest ; \
142 else echo runtest ; fi`
145 # compilers to use to create programs which must be run in the build
148 CXX_FOR_BUILD = $(CXX)
150 SUBDIRS = "this is set via configure, don't edit this"
153 # This is set by the configure script to the list of directories which
154 # should be built using the target tools.
155 TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ libf2c winsup
157 # Target libraries are put under this directory:
158 # Changed by configure to $(target_alias) if cross.
161 # This is set by the configure script to the arguments passed to configure.
164 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
168 # This is the name of the environment variable used for the path to
169 # the libraries. This may be changed by configure.in.
170 RPATH_ENVVAR = LD_LIBRARY_PATH
172 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
173 REALLY_SET_LIB_PATH = \
174 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
175 export $(RPATH_ENVVAR);
178 INSTALL_TARGET = installdirs \
181 $(INSTALL_TARGET_MODULES) \
182 $(INSTALL_X11_MODULES) \
185 INSTALL_TARGET_CROSS = installdirs \
188 $(INSTALL_TARGET_MODULES) \
189 $(INSTALL_X11_MODULES) \
193 if [ -f $$r/gcc/xgcc ] ; then \
194 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
195 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
196 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
198 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
201 echo $$r/gcc/xgcc -B$$r/gcc/; \
204 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
207 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
211 # If CC_FOR_TARGET is not overriden on the command line, then this
212 # variable is passed down to the gcc Makefile, where it is used to
213 # build libgcc2.a. We define it here so that it can itself be
214 # overridden on the command line.
215 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
219 if [ -f $$r/gcc/xgcc ] ; then \
220 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
221 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
222 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
224 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
227 echo $$r/gcc/xgcc -B$$r/gcc/; \
230 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
233 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
238 if [ -f $$r/gas/as-new ] ; then \
239 echo $$r/gas/as-new ; \
241 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
244 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
249 if [ -f $$r/ld/ld-new ] ; then \
250 echo $$r/ld/ld-new ; \
252 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
255 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
259 DLLTOOL_FOR_TARGET = ` \
260 if [ -f $$r/binutils/dlltool ] ; then \
261 echo $$r/binutils/dlltool ; \
263 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
266 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
270 WINDRES_FOR_TARGET = ` \
271 if [ -f $$r/binutils/windres ] ; then \
272 echo $$r/binutils/windres ; \
274 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
277 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
282 if [ -f $$r/binutils/ar ] ; then \
283 echo $$r/binutils/ar ; \
285 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
288 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
292 RANLIB_FOR_TARGET = ` \
293 if [ -f $$r/binutils/ranlib ] ; then \
294 echo $$r/binutils/ranlib ; \
296 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
299 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
304 if [ -f $$r/binutils/nm-new ] ; then \
305 echo $$r/binutils/nm-new ; \
307 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
310 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
314 #### host and target specific makefile fragments come in here.
317 # Flags to pass down to all sub-makes.
318 # Please keep these in alphabetical order.
319 BASE_FLAGS_TO_PASS = \
320 "AR_FLAGS=$(AR_FLAGS)" \
321 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
322 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
324 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
325 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
327 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
328 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
329 "CXXFLAGS=$(CXXFLAGS)" \
330 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
331 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
332 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
333 "INSTALL=$(INSTALL)" \
334 "INSTALL_DATA=$(INSTALL_DATA)" \
335 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
336 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
337 "LDFLAGS=$(LDFLAGS)" \
339 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
340 "LIBCFLAGS=$(LIBCFLAGS)" \
341 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
342 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
343 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
346 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
347 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
348 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
351 "RUNTEST=$(RUNTEST)" \
352 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
353 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
355 "exec_prefix=$(exec_prefix)" \
357 "tooldir=$(tooldir)" \
358 "gxx_include_dir=$(gxx_include_dir)"
360 # Flags to pass down to most sub-makes, in which we're building with
361 # the host environment.
362 # If any variables are added here, they must be added to do-*, below.
368 'DLLTOOL=$(DLLTOOL)' \
374 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
376 # Flags that are concerned with the location of the X11 include files
379 # NOTE: until the top-level is getting the values via autoconf, it only
380 # causes problems to have this top-level Makefile overriding the autoconf-set
381 # values in child directories. Only variables that don't conflict with
382 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
384 X11_FLAGS_TO_PASS = \
385 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
386 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
388 # Flags to pass down to makes which are built with the target environment.
389 # The double $ decreases the length of the command line; the variables
390 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
391 # If any variables are added here, they must be added to do-*, below.
392 EXTRA_TARGET_FLAGS = \
393 'AR=$$(AR_FOR_TARGET)' \
394 'AS=$$(AS_FOR_TARGET)' \
395 'CC=$$(CC_FOR_TARGET)' \
396 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
397 'CXX=$$(CXX_FOR_TARGET)' \
398 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
399 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
400 'LD=$$(LD_FOR_TARGET)' \
401 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
402 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
403 'NM=$$(NM_FOR_TARGET)' \
404 'RANLIB=$$(RANLIB_FOR_TARGET)' \
405 'WINDRES=$$(WINDRES_FOR_TARGET)'
407 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
409 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
410 # unfortunately needs the native compiler and the target ar and
412 # If any variables are added here, they must be added to do-*, below.
413 # The HOST_* variables are a special case, which are used for the gcc
414 # cross-building scheme.
416 'AR=$$(AR_FOR_TARGET)' \
420 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
421 'HOST_CC=$(CC_FOR_BUILD)' \
422 'HOST_PREFIX=$(HOST_PREFIX)' \
423 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
425 'RANLIB=$$(RANLIB_FOR_TARGET)' \
426 'WINDRES=$$(WINDRES_FOR_TARGET)' \
427 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
428 "`if test x'$(LANGUAGES)' != x; then echo 'LANGUAGES=$(LANGUAGES)'; else echo 'XFOO=bar'; fi`" \
429 "`if test x'$(STMP_FIXPROTO)' != x; then echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)'; else echo 'XFOO=bar'; fi`" \
430 "`if test x'$(LIMITS_H_TEST)' != x; then echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)'; else echo 'XFOO=bar'; fi`" \
431 "`if test x'$(LIBGCC1_TEST)' != x; then echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)'; else echo 'XFOO=bar'; fi`" \
432 "`if test x'$(LIBGCC2_CFLAGS)' != x; then echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
433 "`if test x'$(LIBGCC2_DEBUG_CFLAGS)' != x; then echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
434 "`if test x'$(LIBGCC2_INCLUDES)' != x; then echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)'; else echo 'XFOO=bar'; fi`" \
435 "`if test x'$(ENQUIRE)' != x; then echo 'ENQUIRE=$(ENQUIRE)'; else echo 'XFOO=bar'; fi`" \
436 "`if test x'$(BOOT_CFLAGS)' != x; then echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)'; else echo 'XFOO=bar'; fi`"
438 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
440 # This is a list of the targets for all of the modules which are compiled
441 # using $(FLAGS_TO_PASS).
500 # This is a list of the check targets for all of the modules which are
501 # compiled using $(FLAGS_TO_PASS).
503 # The list is in two parts. The first lists those tools which
504 # are tested as part of the host's native tool-chain, and not
505 # tested in a cross configuration.
506 NATIVE_CHECK_MODULES = \
511 CROSS_CHECK_MODULES = \
563 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
565 # This is a list of the install targets for all of the modules which are
566 # compiled using $(FLAGS_TO_PASS).
567 # We put install-opcodes before install-binutils because the installed
568 # binutils might be on PATH, and they might need the shared opcodes
626 # This is a list of the targets for all of the modules which are compiled
627 # using $(X11_FLAGS_TO_PASS).
639 # This is a list of the check targets for all of the modules which are
640 # compiled using $(X11_FLAGS_TO_PASS).
641 CHECK_X11_MODULES = \
651 # This is a list of the install targets for all the modules which are
652 # compiled using $(X11_FLAGS_TO_PASS).
653 INSTALL_X11_MODULES = \
664 # This is a list of the targets for all of the modules which are compiled
665 # using $(TARGET_FLAGS_TO_PASS).
666 ALL_TARGET_MODULES = \
668 all-target-libstdc++ \
674 all-target-libgloss \
675 all-target-libiberty \
679 # This is a list of the configure targets for all of the modules which
680 # are compiled using the target tools.
681 CONFIGURE_TARGET_MODULES = \
682 configure-target-libio \
683 configure-target-libstdc++ \
684 configure-target-librx \
685 configure-target-libg++ \
686 configure-target-newlib \
687 configure-target-libf2c \
688 configure-target-winsup \
689 configure-target-libgloss \
690 configure-target-libiberty \
691 configure-target-gperf \
692 configure-target-examples
694 # This is a list of the check targets for all of the modules which are
695 # compiled using $(TARGET_FLAGS_TO_PASS).
696 CHECK_TARGET_MODULES = \
698 check-target-libstdc++ \
699 check-target-libg++ \
700 check-target-newlib \
701 check-target-libf2c \
702 check-target-winsup \
703 check-target-libiberty \
706 # This is a list of the install targets for all of the modules which are
707 # compiled using $(TARGET_FLAGS_TO_PASS).
708 INSTALL_TARGET_MODULES = \
709 install-target-libio \
710 install-target-libstdc++ \
711 install-target-libg++ \
712 install-target-newlib \
713 install-target-libf2c \
714 install-target-winsup \
715 install-target-libgloss \
716 install-target-libiberty \
719 # This is a list of the targets for which we can do a clean-{target}.
778 # All of the target modules that can be cleaned
779 CLEAN_TARGET_MODULES = \
781 clean-target-libstdc++ \
783 clean-target-libg++ \
784 clean-target-newlib \
785 clean-target-libf2c \
786 clean-target-winsup \
787 clean-target-libgloss \
788 clean-target-libiberty \
790 clean-target-examples
792 # All of the x11 modules that can be cleaned
793 CLEAN_X11_MODULES = \
804 # The first rule in the file had better be this one. Don't put any above it.
808 # The target built for a native build.
813 $(ALL_TARGET_MODULES) \
816 # Do a target for all the subdirectories. A ``make do-X'' will do a
817 # ``make X'' in all subdirectories (because, in general, there is a
818 # dependency (below) of X upon do-X, a ``make X'' will also do this,
819 # but it may do additional work as well).
820 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
821 # because it is so large that it can easily overflow the command line
822 # length limit on some systems.
831 do-maintainer-clean \
835 @target=`echo $@ | sed -e 's/^do-//'`; \
837 s=`cd $(srcdir); pwd`; export s; \
839 for i in $(SUBDIRS) -dummy-; do \
840 if [ -f ./$$i/Makefile ]; then \
843 for flag in $(EXTRA_GCC_FLAGS); do \
844 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
848 for flag in $(EXTRA_HOST_FLAGS); do \
849 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
853 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
855 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
856 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
857 "RANLIB=$${RANLIB}" \
858 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
860 then true; else exit 1; fi; \
863 @target=`echo $@ | sed -e 's/^do-//'`; \
865 s=`cd $(srcdir); pwd`; export s; \
867 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
868 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
869 for flag in $(EXTRA_TARGET_FLAGS); do \
870 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
872 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
873 if (cd $(TARGET_SUBDIR)/$$i; \
874 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
875 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
876 "RANLIB=$${RANLIB}" \
877 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
879 then true; else exit 1; fi; \
883 # Here are the targets which correspond to the do-X targets.
885 .PHONY: info installcheck dvi install-info
886 .PHONY: clean distclean mostlyclean maintainer-clean realclean
887 .PHONY: local-clean local-distclean local-maintainer-clean
889 installcheck: do-installcheck
892 # Make sure makeinfo is built before we do a `make info'.
895 install-info: do-install-info dir.info
896 s=`cd $(srcdir); pwd`; export s; \
897 if [ -f dir.info ] ; then \
898 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
902 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
905 -rm -f Makefile config.status config.cache mh-frag mt-frag
906 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
907 rm -rf $(TARGET_SUBDIR); \
910 local-maintainer-clean:
911 @echo "This command is intended for maintainers to use;"
912 @echo "it deletes files that may require special tools to rebuild."
914 clean: do-clean local-clean
915 mostlyclean: do-mostlyclean local-clean
916 distclean: do-distclean local-clean local-distclean
917 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
918 maintainer-clean: local-distclean
919 realclean: maintainer-clean
921 # This rule is used to clean specific modules.
922 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
923 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
924 @dir=`echo $@ | sed -e 's/clean-//'`; \
925 if [ -f ./$${dir}/Makefile ] ; then \
927 s=`cd $(srcdir); pwd`; export s; \
929 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
934 .PHONY: $(CLEAN_TARGET_MODULES)
935 $(CLEAN_TARGET_MODULES):
936 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
937 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
938 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
940 s=`cd $(srcdir); pwd`; export s; \
942 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
947 clean-target: $(CLEAN_TARGET_MODULES)
952 check: $(CHECK_MODULES) \
953 $(CHECK_TARGET_MODULES) \
954 $(CHECK_X11_MODULES) \
957 # Automated reporting of test results.
959 warning.log: build.log
960 $(srcdir)/contrib/warn_summary build.log > $@
963 if test x'$(BOOT_CFLAGS)' != x''; then \
964 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
966 $(srcdir)/contrib/test_summary -t >$@
968 echo If you really want to send e-mail, run ./$@ now
970 mail-report-with-warnings.log: warning.log
971 if test x'$(BOOT_CFLAGS)' != x''; then \
972 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
974 $(srcdir)/contrib/test_summary -t -i warning.log >$@
976 echo If you really want to send e-mail, run ./$@ now
978 # Installation targets.
980 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
981 install: $(INSTALL_TARGET)
982 install-cross: $(INSTALL_TARGET_CROSS)
985 @echo "the uninstall target is not supported in this tree"
988 $(MAKE) -f ./release/Build-A-Release \
989 host=$(host_alias) source-vault
992 $(MAKE) -f ./release/Build-A-Release \
993 host=$(host_alias) target=$(target_alias)
996 @if [ -f ./release/vault-install ] ; then \
997 ./release/vault-install $(host_alias) $(target_alias) ; \
1003 install.all: install-no-fixedincludes
1004 @if [ -f ./gcc/Makefile ] ; then \
1005 r=`pwd` ; export r ; \
1008 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1013 # inet-install is used because the I*Net wants DejaGNU installed but
1014 # not built. Similarly, gzip is built but not installed.
1016 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1018 # install-no-fixedincludes is used because Cygnus can not distribute
1019 # the fixed header files.
1020 .PHONY: install-no-fixedincludes
1021 install-no-fixedincludes: \
1023 $(INSTALL_MODULES) \
1024 $(INSTALL_TARGET_MODULES) \
1025 $(INSTALL_X11_MODULES) \
1026 gcc-no-fixedincludes
1028 # Install the gcc headers files, but not the fixed include files,
1029 # which Cygnus is not allowed to distribute. This rule is very
1030 # dependent on the workings of the gcc Makefile.in.
1031 .PHONY: gcc-no-fixedincludes
1032 gcc-no-fixedincludes:
1033 @if [ -f ./gcc/Makefile ]; then \
1034 rm -rf gcc/tmp-include; \
1035 mv gcc/include gcc/tmp-include 2>/dev/null; \
1036 mkdir gcc/include; \
1037 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1038 touch gcc/stmp-fixinc gcc/include/fixed; \
1039 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1040 r=`pwd`; export r; \
1041 s=`cd $(srcdir); pwd` ; export s; \
1044 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1045 rm -rf gcc/include; \
1046 mv gcc/tmp-include gcc/include 2>/dev/null; \
1049 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1050 # build a target all-X means to cd to X and make all.
1052 # all-gui, and all-libproc are handled specially because
1053 # they are still experimental, and if they fail to build, that
1054 # shouldn't stop "make all".
1055 .PHONY: $(ALL_MODULES) all-gui all-libproc
1056 $(ALL_MODULES) all-gui all-libproc:
1057 @dir=`echo $@ | sed -e 's/all-//'`; \
1058 if [ -f ./$${dir}/Makefile ] ; then \
1059 r=`pwd`; export r; \
1060 s=`cd $(srcdir); pwd`; export s; \
1062 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1067 # These rules are used to check the modules which use FLAGS_TO_PASS.
1068 # To build a target check-X means to cd to X and make check. Some
1069 # modules are only tested in a native toolchain.
1071 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1072 $(NATIVE_CHECK_MODULES):
1073 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1074 dir=`echo $@ | sed -e 's/check-//'`; \
1075 if [ -f ./$${dir}/Makefile ] ; then \
1076 r=`pwd`; export r; \
1077 s=`cd $(srcdir); pwd`; export s; \
1079 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1085 $(CROSS_CHECK_MODULES):
1086 @dir=`echo $@ | sed -e 's/check-//'`; \
1087 if [ -f ./$${dir}/Makefile ] ; then \
1088 r=`pwd`; export r; \
1089 s=`cd $(srcdir); pwd`; export s; \
1091 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1096 # This rule is used to install the modules which use FLAGS_TO_PASS.
1097 # To build a target install-X means to cd to X and make install.
1098 .PHONY: $(INSTALL_MODULES)
1099 $(INSTALL_MODULES): installdirs
1100 @dir=`echo $@ | sed -e 's/install-//'`; \
1101 if [ -f ./$${dir}/Makefile ] ; then \
1102 r=`pwd`; export r; \
1103 s=`cd $(srcdir); pwd`; export s; \
1105 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1110 # This rule is used to configure the modules which are built with the
1112 .PHONY: $(CONFIGURE_TARGET_MODULES)
1113 $(CONFIGURE_TARGET_MODULES):
1114 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1115 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1116 r=`pwd`; export r; \
1117 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1118 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1119 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1120 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1121 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1123 echo "Multilibs changed for $${dir}, reconfiguring"; \
1124 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1125 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1128 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1131 fi; exit 0 # break command into two pieces
1132 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1133 if [ ! -d $(TARGET_SUBDIR) ]; then \
1135 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1137 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1138 if [ -d $(srcdir)/$${dir} ]; then \
1139 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1140 r=`pwd`; export r; \
1141 s=`cd $(srcdir); pwd`; export s; \
1143 AR="$(AR_FOR_TARGET)"; export AR; \
1144 AS="$(AS_FOR_TARGET)"; export AS; \
1145 CC="$(CC_FOR_TARGET)"; export CC; \
1146 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1147 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1148 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1149 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1150 LD="$(LD_FOR_TARGET)"; export LD; \
1151 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1152 NM="$(NM_FOR_TARGET)"; export NM; \
1153 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1154 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1155 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1156 cd $(TARGET_SUBDIR)/$${dir}; \
1159 topdir=$(srcdir) ;; \
1161 case "$(TARGET_SUBDIR)" in \
1162 .) topdir="../$(srcdir)" ;; \
1163 *) topdir="../../$(srcdir)" ;; \
1166 if [ "$(srcdir)" = "." ] ; then \
1167 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1168 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1169 if [ -f Makefile ]; then \
1170 if $(MAKE) distclean; then \
1184 srcdiroption="--srcdir=."; \
1187 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1188 libsrcdir="$$s/$${dir}"; \
1190 if [ -f $${libsrcdir}/configure ] ; then \
1191 rm -f no-such-file; \
1192 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1193 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1194 --with-target-subdir="$(TARGET_SUBDIR)"; \
1196 rm -f no-such-file; \
1197 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1198 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1199 --with-target-subdir="$(TARGET_SUBDIR)"; \
1208 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1209 # To build a target all-X means to cd to X and make all.
1210 .PHONY: $(ALL_TARGET_MODULES)
1211 $(ALL_TARGET_MODULES):
1212 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1213 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1214 r=`pwd`; export r; \
1215 s=`cd $(srcdir); pwd`; export s; \
1217 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1222 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1223 # To build a target install-X means to cd to X and make install.
1224 .PHONY: $(CHECK_TARGET_MODULES)
1225 $(CHECK_TARGET_MODULES):
1226 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1227 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1228 r=`pwd`; export r; \
1229 s=`cd $(srcdir); pwd`; export s; \
1231 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1236 # This rule is used to install the modules which use
1237 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1239 .PHONY: $(INSTALL_TARGET_MODULES)
1240 $(INSTALL_TARGET_MODULES): installdirs
1241 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1242 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1243 r=`pwd`; export r; \
1244 s=`cd $(srcdir); pwd`; export s; \
1246 (cd $(TARGET_SUBDIR)/$${dir}; \
1247 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1252 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1253 # To build a target all-X means to cd to X and make all.
1254 .PHONY: $(ALL_X11_MODULES)
1256 @dir=`echo $@ | sed -e 's/all-//'`; \
1257 if [ -f ./$${dir}/Makefile ] ; then \
1258 r=`pwd`; export r; \
1259 s=`cd $(srcdir); pwd`; export s; \
1262 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1267 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1268 # To build a target check-X means to cd to X and make all.
1269 .PHONY: $(CHECK_X11_MODULES)
1270 $(CHECK_X11_MODULES):
1271 @dir=`echo $@ | sed -e 's/check-//'`; \
1272 if [ -f ./$${dir}/Makefile ] ; then \
1273 r=`pwd`; export r; \
1274 s=`cd $(srcdir); pwd`; export s; \
1277 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1282 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1283 # To build a target install-X means to cd to X and make install.
1284 .PHONY: $(INSTALL_X11_MODULES)
1285 $(INSTALL_X11_MODULES): installdirs
1286 @dir=`echo $@ | sed -e 's/install-//'`; \
1287 if [ -f ./$${dir}/Makefile ] ; then \
1288 r=`pwd`; export r; \
1289 s=`cd $(srcdir); pwd`; export s; \
1292 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1297 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1300 @if [ -f ./gcc/Makefile ] ; then \
1301 r=`pwd`; export r; \
1302 s=`cd $(srcdir); pwd`; export s; \
1304 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1309 # Building GCC uses some tools for rebuilding "source" files
1310 # like texinfo, bison/byacc, etc. So we must depend on those.
1312 # While building GCC, it may be necessary to run various target
1313 # programs like the assembler, linker, etc. So we depend on
1316 # In theory, on an SMP all those dependencies can be resolved
1319 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1320 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1321 @r=`pwd`; export r; \
1322 s=`cd $(srcdir); pwd`; export s; \
1324 echo "Bootstrapping the compiler"; \
1325 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1326 @r=`pwd`; export r; \
1327 s=`cd $(srcdir); pwd`; export s; \
1329 *bootstrap4-lean ) \
1330 msg="Comparing stage3 and stage4 of the compiler"; \
1331 compare=compare3-lean ;; \
1332 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1333 compare=compare3 ;; \
1334 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1335 compare=compare-lean ;; \
1336 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1337 compare=compare ;; \
1341 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1342 @echo "Building runtime libraries"; \
1346 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1347 @r=`pwd`; export r; \
1348 s=`cd $(srcdir); pwd`; export s; \
1350 echo "Building the C and C++ compiler"; \
1351 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1352 @echo "Building runtime libraries"; \
1353 $(MAKE) all LANGUAGES="c c++"
1357 @if [ -f ./gcc/Makefile ] ; then \
1358 r=`pwd`; export r; \
1359 s=`cd $(srcdir); pwd`; export s; \
1361 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1368 @if [ -f ./gcc/Makefile ] ; then \
1369 r=`pwd`; export r; \
1370 s=`cd $(srcdir); pwd`; export s; \
1372 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1377 .PHONY: install-gcc-cross
1379 @if [ -f ./gcc/Makefile ] ; then \
1380 r=`pwd`; export r; \
1381 s=`cd $(srcdir); pwd`; export s; \
1383 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1387 # EXPERIMENTAL STUFF
1388 # This rule is used to install the modules which use FLAGS_TO_PASS.
1389 # To build a target install-X means to cd to X and make install.
1390 .PHONY: install-dosrel
1391 install-dosrel: installdirs info
1392 @dir=`echo $@ | sed -e 's/install-//'`; \
1393 if [ -f ./$${dir}/Makefile ] ; then \
1394 r=`pwd`; export r; \
1395 s=`cd $(srcdir); pwd`; export s; \
1397 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1402 install-dosrel-fake:
1405 # This is a list of inter-dependencies among modules.
1407 all-autoconf: all-m4 all-texinfo
1411 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc
1412 all-bison: all-texinfo
1416 all-dejagnu: all-tcl all-expect all-tk
1417 all-diff: all-libiberty
1419 all-emacs19: all-bison all-byacc
1421 configure-target-examples: $(ALL_GCC)
1422 all-target-examples: configure-target-examples
1423 all-expect: all-tcl all-tk
1424 all-fileutils: all-libiberty
1427 all-flex: all-libiberty all-bison all-byacc
1428 all-gas: all-libiberty all-opcodes all-bfd
1432 all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1433 GDB_TK = all-tk all-tcl all-itcl all-tix
1434 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1436 configure-target-gperf: $(ALL_GCC)
1437 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libg++
1438 all-gprof: all-libiberty all-bfd all-opcodes
1439 all-grep: all-libiberty
1440 all-grez: all-libiberty all-bfd all-opcodes
1441 all-gui: all-gdb all-libproc all-target-librx
1443 all-gzip: all-libiberty
1444 all-hello: all-libiberty
1446 all-inet: all-tcl all-send-pr all-perl
1447 all-ispell: all-emacs19
1448 all-itcl: all-tcl all-tk
1449 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex
1450 configure-target-libg++: $(ALL_GCC) configure-target-librx
1451 all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
1452 configure-target-libgloss: $(ALL_GCC)
1453 all-target-libgloss: configure-target-libgloss configure-target-newlib
1454 configure-target-libio: $(ALL_GCC)
1455 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1456 check-target-libio: all-target-libstdc++
1458 configure-target-librx: $(ALL_GCC) configure-target-newlib
1459 all-target-librx: configure-target-librx
1460 configure-target-libstdc++: $(ALL_GCC)
1461 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1462 all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1463 all-m4: all-libiberty
1464 all-make: all-libiberty
1466 configure-target-newlib: $(ALL_GCC)
1467 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1468 all-opcodes: all-bfd all-libiberty
1469 all-patch: all-libiberty
1471 all-prms: all-libiberty
1474 all-recode: all-libiberty
1475 all-sed: all-libiberty
1476 all-send-pr: all-prms
1478 all-sim: all-libiberty all-bfd all-opcodes
1479 all-sn: all-tcl all-tk all-itcl all-db all-grep
1480 all-tar: all-libiberty
1482 all-tclX: all-tcl all-tk
1484 all-texinfo: all-libiberty
1486 all-tgas: all-libiberty all-bfd all-opcodes
1488 all-tix: all-tcl all-tk
1490 all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup
1491 configure-target-winsup: configure-target-newlib
1492 all-uudecode: all-libiberty
1493 configure-target-libiberty: $(ALL_GCC)
1494 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1495 all-target: $(ALL_TARGET_MODULES)
1496 install-target: $(INSTALL_TARGET_MODULES)
1498 ### other supporting targets
1504 installdirs: mkinstalldirs
1505 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1507 dir.info: do-install-info
1508 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1509 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1510 mv -f dir.info.new dir.info ; \
1515 @echo "Building a full distribution of this tree isn't done"
1516 @echo "via 'make dist'. Check out the etc/ subdirectory"
1520 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1521 # ability to use several tags files at once, so there is probably no need
1522 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1523 # (if we felt like it) have this Makefile write a piece of elisp which
1524 # the user could load to tell emacs19 where all the TAGS files we just
1528 # with the gnu make, this is done automatically.
1530 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1531 $(SHELL) ./config.status
1534 # Support for building net releases
1536 # Files in devo used in any net release.
1537 # ChangeLog omitted because it may refer to files which are not in this
1538 # distribution (perhaps it would be better to include it anyway).
1539 DEVO_SUPPORT= README Makefile.in configure configure.in \
1540 config.guess config.sub config move-if-change \
1541 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1542 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1543 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1545 # Files in devo/etc used in any net release.
1546 # ChangeLog omitted because it may refer to files which are not in this
1547 # distribution (perhaps it would be better to include it anyway).
1548 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1549 make-stds.texi standards.info*
1551 # When you use `make setup-dirs' or `make taz' you should always redefine
1553 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1557 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1558 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1559 # Take out texinfo from a few places; make simple BISON=bison line.
1560 sed -e '/^all\.normal: /s/\all-texinfo //' \
1561 -e '/^ install-texinfo /d' \
1563 mv -f tmp Makefile.in
1566 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1567 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1568 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1569 # Make links, and run "make diststuff" or "make info" when needed.
1570 rm -rf proto-toplev ; mkdir proto-toplev
1571 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1572 for d in $$dirs ; do \
1573 if [ -d $$d ]; then \
1574 if [ ! -f $$d/Makefile ] ; then true ; \
1575 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1576 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1577 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1578 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1580 if [ -d $$d/proto-$$d.dir ]; then \
1581 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1583 ln -s ../$$d proto-toplev/$$d ; \
1585 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1587 cd etc ; $(MAKE) info
1590 mkdir proto-toplev/etc
1591 (cd proto-toplev/etc; \
1592 for i in $(ETC_SUPPORT); do \
1593 ln -s ../../etc/$$i . ; \
1596 # Take out texinfo from configurable dirs
1597 rm proto-toplev/configure.in
1598 sed -e '/^host_tools=/s/texinfo //' \
1599 <configure.in >proto-toplev/configure.in
1601 mkdir proto-toplev/texinfo
1602 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1603 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1604 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1605 if test -r texinfo/util/tex3patch ; then \
1606 mkdir proto-toplev/texinfo/util && \
1607 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1609 chmod og=u `find . -print`
1610 if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1611 ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
1613 ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1615 $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
1618 echo "==> Making $(TOOL)-$(VER).tar.gz"
1619 -rm -f $(TOOL)-$(VER)
1620 ln -s proto-toplev $(TOOL)-$(VER)
1621 tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1622 $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1624 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1625 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1628 GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1629 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1630 $(MAKE) -f Makefile.in taz TOOL=gas \
1631 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1633 # The FSF "binutils" release includes gprof and ld.
1634 .PHONY: binutils.tar.gz
1635 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1636 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1637 $(MAKE) -f Makefile.in taz TOOL=binutils \
1638 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1640 .PHONY: gas+binutils.tar.gz
1641 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1642 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1643 $(MAKE) -f Makefile.in taz TOOL=gas \
1644 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1646 .PHONY: libg++.tar.gz
1647 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1648 libg++.tar.gz: $(DIST_SUPPORT) libg++
1649 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1650 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1652 GNATS_SUPPORT_DIRS=include libiberty send-pr
1653 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1654 $(MAKE) -f Makefile.in taz TOOL=gnats \
1655 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1658 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1659 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1660 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1661 $(MAKE) -f Makefile.in taz TOOL=gdb \
1662 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1664 .PHONY: newlib.tar.gz
1665 NEWLIB_SUPPORT_DIRS=libgloss
1666 # taz configures for the sun4 target which won't configure newlib.
1667 # We need newlib configured so that the .info files are made.
1668 # Unfortunately, it is not enough to just configure newlib separately:
1669 # taz will build the .info files but since SUBDIRS won't contain newlib,
1670 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1671 # used in building the .info files, eg: *.def, *.ref).
1672 # The problem isn't solvable however without a lot of extra work because
1673 # target libraries are built in subdir $(target_alias) which gets nuked during
1674 # the make distclean. For now punt on the issue of shipping newlib info files
1675 # with newlib net releases and wait for a day when some native target (sun4?)
1676 # supports newlib (if only minimally).
1677 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1678 $(MAKE) -f Makefile.in taz TOOL=newlib \
1679 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1680 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1686 # end of Makefile.in