2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 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.
104 BISON = `if [ -f $$r/bison/bison ] ; then \
105 echo $$r/bison/bison -L $$s/bison/ ; \
110 YACC = `if [ -f $$r/bison/bison ] ; then \
111 echo $$r/bison/bison -y -L $$s/bison/ ; \
112 elif [ -f $$r/byacc/byacc ] ; then \
113 echo $$r/byacc/byacc ; \
115 echo ${DEFAULT_YACC} ; \
118 LEX = `if [ -f $$r/flex/flex ] ; \
119 then echo $$r/flex/flex ; \
120 else echo ${DEFAULT_LEX} ; fi`
122 M4 = `if [ -f $$r/m4/m4 ] ; \
123 then echo $$r/m4/m4 ; \
126 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
127 then echo $$r/texinfo/makeinfo/makeinfo ; \
128 else echo makeinfo ; fi`
130 # This just becomes part of the MAKEINFO definition passed down to
131 # sub-makes. It lets flags be given on the command line while still
132 # using the makeinfo from the object tree.
135 EXPECT = `if [ -f $$r/expect/expect ] ; \
136 then echo $$r/expect/expect ; \
137 else echo expect ; fi`
139 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
140 then echo $$s/dejagnu/runtest ; \
141 else echo runtest ; fi`
144 # compilers to use to create programs which must be run in the build
147 CXX_FOR_BUILD = $(CXX)
149 SUBDIRS = "this is set via configure, don't edit this"
152 # This is set by the configure script to the list of directories which
153 # should be built using the target tools.
154 TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ libf2c winsup
156 # Target libraries are put under this directory:
157 # Changed by configure to $(target_alias) if cross.
160 # This is set by the configure script to the arguments passed to configure.
163 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
167 # This is the name of the environment variable used for the path to
168 # the libraries. This may be changed by configure.in.
169 RPATH_ENVVAR = LD_LIBRARY_PATH
171 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
172 REALLY_SET_LIB_PATH = \
173 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
174 export $(RPATH_ENVVAR);
177 INSTALL_TARGET = installdirs \
180 $(INSTALL_TARGET_MODULES) \
181 $(INSTALL_X11_MODULES) \
184 INSTALL_TARGET_CROSS = installdirs \
187 $(INSTALL_TARGET_MODULES) \
188 $(INSTALL_X11_MODULES) \
192 if [ -f $$r/gcc/xgcc ] ; then \
193 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
194 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
195 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
197 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
200 echo $$r/gcc/xgcc -B$$r/gcc/; \
203 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
206 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
210 # If CC_FOR_TARGET is not overriden on the command line, then this
211 # variable is passed down to the gcc Makefile, where it is used to
212 # build libgcc2.a. We define it here so that it can itself be
213 # overridden on the command line.
214 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
218 if [ -f $$r/gcc/xgcc ] ; then \
219 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
220 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
221 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
223 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
226 echo $$r/gcc/xgcc -B$$r/gcc/; \
229 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
232 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
237 if [ -f $$r/gas/as-new ] ; then \
238 echo $$r/gas/as-new ; \
240 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
243 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
248 if [ -f $$r/ld/ld-new ] ; then \
249 echo $$r/ld/ld-new ; \
251 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
254 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
258 DLLTOOL_FOR_TARGET = ` \
259 if [ -f $$r/binutils/dlltool ] ; then \
260 echo $$r/binutils/dlltool ; \
262 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
265 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
269 WINDRES_FOR_TARGET = ` \
270 if [ -f $$r/binutils/windres ] ; then \
271 echo $$r/binutils/windres ; \
273 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
276 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
281 if [ -f $$r/binutils/ar ] ; then \
282 echo $$r/binutils/ar ; \
284 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
287 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
291 RANLIB_FOR_TARGET = ` \
292 if [ -f $$r/binutils/ranlib ] ; then \
293 echo $$r/binutils/ranlib ; \
295 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
298 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
303 if [ -f $$r/binutils/nm-new ] ; then \
304 echo $$r/binutils/nm-new ; \
306 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
309 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
313 #### host and target specific makefile fragments come in here.
316 # Flags to pass down to all sub-makes.
317 # Please keep these in alphabetical order.
318 BASE_FLAGS_TO_PASS = \
319 "AR_FLAGS=$(AR_FLAGS)" \
320 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
321 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
323 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
324 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
326 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
327 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
328 "CXXFLAGS=$(CXXFLAGS)" \
329 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
330 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
331 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
332 "INSTALL=$(INSTALL)" \
333 "INSTALL_DATA=$(INSTALL_DATA)" \
334 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
335 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
336 "LDFLAGS=$(LDFLAGS)" \
338 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
339 "LIBCFLAGS=$(LIBCFLAGS)" \
340 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
341 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
342 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
345 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
346 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
347 "PICFLAG=$(PICFLAG)" \
348 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
349 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
352 "RUNTEST=$(RUNTEST)" \
353 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
354 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
356 "exec_prefix=$(exec_prefix)" \
358 "tooldir=$(tooldir)" \
359 "gxx_include_dir=$(gxx_include_dir)"
361 # Flags to pass down to most sub-makes, in which we're building with
362 # the host environment.
363 # If any variables are added here, they must be added to do-*, below.
369 'DLLTOOL=$(DLLTOOL)' \
375 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
377 # Flags that are concerned with the location of the X11 include files
380 # NOTE: until the top-level is getting the values via autoconf, it only
381 # causes problems to have this top-level Makefile overriding the autoconf-set
382 # values in child directories. Only variables that don't conflict with
383 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
385 X11_FLAGS_TO_PASS = \
386 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
387 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
389 # Flags to pass down to makes which are built with the target environment.
390 # The double $ decreases the length of the command line; the variables
391 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
392 # If any variables are added here, they must be added to do-*, below.
393 EXTRA_TARGET_FLAGS = \
394 'AR=$$(AR_FOR_TARGET)' \
395 'AS=$$(AS_FOR_TARGET)' \
396 'CC=$$(CC_FOR_TARGET)' \
397 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
398 'CXX=$$(CXX_FOR_TARGET)' \
399 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
400 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
401 'LD=$$(LD_FOR_TARGET)' \
402 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
403 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
404 'NM=$$(NM_FOR_TARGET)' \
405 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
406 'RANLIB=$$(RANLIB_FOR_TARGET)' \
407 'WINDRES=$$(WINDRES_FOR_TARGET)'
409 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
411 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
412 # unfortunately needs the native compiler and the target ar and
414 # If any variables are added here, they must be added to do-*, below.
415 # The HOST_* variables are a special case, which are used for the gcc
416 # cross-building scheme.
418 'AR=$$(AR_FOR_TARGET)' \
422 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
423 'HOST_CC=$(CC_FOR_BUILD)' \
424 'HOST_PREFIX=$(HOST_PREFIX)' \
425 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
427 'RANLIB=$$(RANLIB_FOR_TARGET)' \
428 'WINDRES=$$(WINDRES_FOR_TARGET)' \
429 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
430 "`if test x'$(LANGUAGES)' != x; then echo 'LANGUAGES=$(LANGUAGES)'; else echo 'XFOO=bar'; fi`" \
431 "`if test x'$(STMP_FIXPROTO)' != x; then echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)'; else echo 'XFOO=bar'; fi`" \
432 "`if test x'$(LIMITS_H_TEST)' != x; then echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)'; else echo 'XFOO=bar'; fi`" \
433 "`if test x'$(LIBGCC1_TEST)' != x; then echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)'; else echo 'XFOO=bar'; fi`" \
434 "`if test x'$(LIBGCC2_CFLAGS)' != x; then echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
435 "`if test x'$(LIBGCC2_DEBUG_CFLAGS)' != x; then echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
436 "`if test x'$(LIBGCC2_INCLUDES)' != x; then echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)'; else echo 'XFOO=bar'; fi`" \
437 "`if test x'$(ENQUIRE)' != x; then echo 'ENQUIRE=$(ENQUIRE)'; else echo 'XFOO=bar'; fi`" \
438 "`if test x'$(BOOT_CFLAGS)' != x; then echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)'; else echo 'XFOO=bar'; fi`"
440 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
442 # This is a list of the targets for all of the modules which are compiled
443 # using $(FLAGS_TO_PASS).
502 # This is a list of the check targets for all of the modules which are
503 # compiled using $(FLAGS_TO_PASS).
505 # The list is in two parts. The first lists those tools which
506 # are tested as part of the host's native tool-chain, and not
507 # tested in a cross configuration.
508 NATIVE_CHECK_MODULES = \
513 CROSS_CHECK_MODULES = \
565 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
567 # This is a list of the install targets for all of the modules which are
568 # compiled using $(FLAGS_TO_PASS).
569 # We put install-opcodes before install-binutils because the installed
570 # binutils might be on PATH, and they might need the shared opcodes
629 # This is a list of the targets for all of the modules which are compiled
630 # using $(X11_FLAGS_TO_PASS).
642 # This is a list of the check targets for all of the modules which are
643 # compiled using $(X11_FLAGS_TO_PASS).
644 CHECK_X11_MODULES = \
654 # This is a list of the install targets for all the modules which are
655 # compiled using $(X11_FLAGS_TO_PASS).
656 INSTALL_X11_MODULES = \
667 # This is a list of the targets for all of the modules which are compiled
668 # using $(TARGET_FLAGS_TO_PASS).
669 ALL_TARGET_MODULES = \
671 all-target-libstdc++ \
677 all-target-libgloss \
678 all-target-libiberty \
682 # This is a list of the configure targets for all of the modules which
683 # are compiled using the target tools.
684 CONFIGURE_TARGET_MODULES = \
685 configure-target-libio \
686 configure-target-libstdc++ \
687 configure-target-librx \
688 configure-target-libg++ \
689 configure-target-newlib \
690 configure-target-libf2c \
691 configure-target-winsup \
692 configure-target-libgloss \
693 configure-target-libiberty \
694 configure-target-gperf \
695 configure-target-examples
697 # This is a list of the check targets for all of the modules which are
698 # compiled using $(TARGET_FLAGS_TO_PASS).
699 CHECK_TARGET_MODULES = \
701 check-target-libstdc++ \
702 check-target-libg++ \
703 check-target-newlib \
704 check-target-libf2c \
705 check-target-winsup \
706 check-target-libiberty \
709 # This is a list of the install targets for all of the modules which are
710 # compiled using $(TARGET_FLAGS_TO_PASS).
711 INSTALL_TARGET_MODULES = \
712 install-target-libio \
713 install-target-libstdc++ \
714 install-target-libg++ \
715 install-target-newlib \
716 install-target-libf2c \
717 install-target-winsup \
718 install-target-libgloss \
719 install-target-libiberty \
722 # This is a list of the targets for which we can do a clean-{target}.
781 # All of the target modules that can be cleaned
782 CLEAN_TARGET_MODULES = \
784 clean-target-libstdc++ \
786 clean-target-libg++ \
787 clean-target-newlib \
788 clean-target-libf2c \
789 clean-target-winsup \
790 clean-target-libgloss \
791 clean-target-libiberty \
793 clean-target-examples
795 # All of the x11 modules that can be cleaned
796 CLEAN_X11_MODULES = \
807 # The first rule in the file had better be this one. Don't put any above it.
811 # The target built for a native build.
816 $(ALL_TARGET_MODULES) \
819 # Do a target for all the subdirectories. A ``make do-X'' will do a
820 # ``make X'' in all subdirectories (because, in general, there is a
821 # dependency (below) of X upon do-X, a ``make X'' will also do this,
822 # but it may do additional work as well).
823 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
824 # because it is so large that it can easily overflow the command line
825 # length limit on some systems.
834 do-maintainer-clean \
838 @target=`echo $@ | sed -e 's/^do-//'`; \
840 s=`cd $(srcdir); pwd`; export s; \
842 for i in $(SUBDIRS) -dummy-; do \
843 if [ -f ./$$i/Makefile ]; then \
846 for flag in $(EXTRA_GCC_FLAGS); do \
847 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
851 for flag in $(EXTRA_HOST_FLAGS); do \
852 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
856 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
858 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
859 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
860 "RANLIB=$${RANLIB}" \
861 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
863 then true; else exit 1; fi; \
866 @target=`echo $@ | sed -e 's/^do-//'`; \
868 s=`cd $(srcdir); pwd`; export s; \
870 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
871 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
872 for flag in $(EXTRA_TARGET_FLAGS); do \
873 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
875 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
876 if (cd $(TARGET_SUBDIR)/$$i; \
877 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
878 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
879 "RANLIB=$${RANLIB}" \
880 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
882 then true; else exit 1; fi; \
886 # Here are the targets which correspond to the do-X targets.
888 .PHONY: info installcheck dvi install-info
889 .PHONY: clean distclean mostlyclean maintainer-clean realclean
890 .PHONY: local-clean local-distclean local-maintainer-clean
892 installcheck: do-installcheck
895 # Make sure makeinfo is built before we do a `make info'.
898 install-info: do-install-info dir.info
899 s=`cd $(srcdir); pwd`; export s; \
900 if [ -f dir.info ] ; then \
901 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
905 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
908 -rm -f Makefile config.status config.cache mh-frag mt-frag
909 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
910 rm -rf $(TARGET_SUBDIR); \
913 local-maintainer-clean:
914 @echo "This command is intended for maintainers to use;"
915 @echo "it deletes files that may require special tools to rebuild."
917 clean: do-clean local-clean
918 mostlyclean: do-mostlyclean local-clean
919 distclean: do-distclean local-clean local-distclean
920 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
921 maintainer-clean: local-distclean
922 realclean: maintainer-clean
924 # This rule is used to clean specific modules.
925 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
926 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
927 @dir=`echo $@ | sed -e 's/clean-//'`; \
928 if [ -f ./$${dir}/Makefile ] ; then \
930 s=`cd $(srcdir); pwd`; export s; \
932 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
937 .PHONY: $(CLEAN_TARGET_MODULES)
938 $(CLEAN_TARGET_MODULES):
939 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
940 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
941 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
943 s=`cd $(srcdir); pwd`; export s; \
945 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
950 clean-target: $(CLEAN_TARGET_MODULES)
955 check: $(CHECK_MODULES) \
956 $(CHECK_TARGET_MODULES) \
957 $(CHECK_X11_MODULES) \
960 # Installation targets.
962 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
963 install: $(INSTALL_TARGET)
964 install-cross: $(INSTALL_TARGET_CROSS)
967 @echo "the uninstall target is not supported in this tree"
970 $(MAKE) -f ./release/Build-A-Release \
971 host=$(host_alias) source-vault
974 $(MAKE) -f ./release/Build-A-Release \
975 host=$(host_alias) target=$(target_alias)
978 @if [ -f ./release/vault-install ] ; then \
979 ./release/vault-install $(host_alias) $(target_alias) ; \
985 install.all: install-no-fixedincludes
986 @if [ -f ./gcc/Makefile ] ; then \
987 r=`pwd` ; export r ; \
990 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
995 # inet-install is used because the I*Net wants DejaGNU installed but
996 # not built. Similarly, gzip is built but not installed.
998 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1000 # install-no-fixedincludes is used because Cygnus can not distribute
1001 # the fixed header files.
1002 .PHONY: install-no-fixedincludes
1003 install-no-fixedincludes: \
1005 $(INSTALL_MODULES) \
1006 $(INSTALL_TARGET_MODULES) \
1007 $(INSTALL_X11_MODULES) \
1008 gcc-no-fixedincludes
1010 # Install the gcc headers files, but not the fixed include files,
1011 # which Cygnus is not allowed to distribute. This rule is very
1012 # dependent on the workings of the gcc Makefile.in.
1013 .PHONY: gcc-no-fixedincludes
1014 gcc-no-fixedincludes:
1015 @if [ -f ./gcc/Makefile ]; then \
1016 rm -rf gcc/tmp-include; \
1017 mv gcc/include gcc/tmp-include 2>/dev/null; \
1018 mkdir gcc/include; \
1019 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1020 touch gcc/stmp-fixinc gcc/include/fixed; \
1021 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1022 r=`pwd`; export r; \
1023 s=`cd $(srcdir); pwd` ; export s; \
1026 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1027 rm -rf gcc/include; \
1028 mv gcc/tmp-include gcc/include 2>/dev/null; \
1031 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1032 # build a target all-X means to cd to X and make all.
1034 # all-gui, and all-libproc are handled specially because
1035 # they are still experimental, and if they fail to build, that
1036 # shouldn't stop "make all".
1037 .PHONY: $(ALL_MODULES) all-gui all-libproc
1038 $(ALL_MODULES) all-gui all-libproc:
1039 @dir=`echo $@ | sed -e 's/all-//'`; \
1040 if [ -f ./$${dir}/Makefile ] ; then \
1041 r=`pwd`; export r; \
1042 s=`cd $(srcdir); pwd`; export s; \
1044 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1049 # These rules are used to check the modules which use FLAGS_TO_PASS.
1050 # To build a target check-X means to cd to X and make check. Some
1051 # modules are only tested in a native toolchain.
1053 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1054 $(NATIVE_CHECK_MODULES):
1055 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1056 dir=`echo $@ | sed -e 's/check-//'`; \
1057 if [ -f ./$${dir}/Makefile ] ; then \
1058 r=`pwd`; export r; \
1059 s=`cd $(srcdir); pwd`; export s; \
1061 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1067 $(CROSS_CHECK_MODULES):
1068 @dir=`echo $@ | sed -e 's/check-//'`; \
1069 if [ -f ./$${dir}/Makefile ] ; then \
1070 r=`pwd`; export r; \
1071 s=`cd $(srcdir); pwd`; export s; \
1073 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1078 # This rule is used to install the modules which use FLAGS_TO_PASS.
1079 # To build a target install-X means to cd to X and make install.
1080 .PHONY: $(INSTALL_MODULES)
1081 $(INSTALL_MODULES): installdirs
1082 @dir=`echo $@ | sed -e 's/install-//'`; \
1083 if [ -f ./$${dir}/Makefile ] ; then \
1084 r=`pwd`; export r; \
1085 s=`cd $(srcdir); pwd`; export s; \
1087 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1092 # This rule is used to configure the modules which are built with the
1094 .PHONY: $(CONFIGURE_TARGET_MODULES)
1095 $(CONFIGURE_TARGET_MODULES):
1096 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1097 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1098 r=`pwd`; export r; \
1099 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1100 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1101 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1102 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1103 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1105 echo "Multilibs changed for $${dir}, reconfiguring"; \
1106 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1107 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1110 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1113 fi; exit 0 # break command into two pieces
1114 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1115 if [ ! -d $(TARGET_SUBDIR) ]; then \
1117 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1119 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1120 if [ -d $(srcdir)/$${dir} ]; then \
1121 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1122 r=`pwd`; export r; \
1123 s=`cd $(srcdir); pwd`; export s; \
1125 AR="$(AR_FOR_TARGET)"; export AR; \
1126 AS="$(AS_FOR_TARGET)"; export AS; \
1127 CC="$(CC_FOR_TARGET)"; export CC; \
1128 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1129 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1130 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1131 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1132 LD="$(LD_FOR_TARGET)"; export LD; \
1133 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1134 NM="$(NM_FOR_TARGET)"; export NM; \
1135 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1136 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1137 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1138 cd $(TARGET_SUBDIR)/$${dir}; \
1141 topdir=$(srcdir) ;; \
1143 case "$(TARGET_SUBDIR)" in \
1144 .) topdir="../$(srcdir)" ;; \
1145 *) topdir="../../$(srcdir)" ;; \
1148 if [ "$(srcdir)" = "." ] ; then \
1149 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1150 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1151 if [ -f Makefile ]; then \
1152 if $(MAKE) distclean; then \
1166 srcdiroption="--srcdir=."; \
1169 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1170 libsrcdir="$$s/$${dir}"; \
1172 if [ -f $${libsrcdir}/configure ] ; then \
1173 $(SHELL) $${libsrcdir}/configure \
1174 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1175 --with-target-subdir="$(TARGET_SUBDIR)"; \
1177 $(SHELL) $$s/configure \
1178 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1179 --with-target-subdir="$(TARGET_SUBDIR)"; \
1188 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1189 # To build a target all-X means to cd to X and make all.
1190 .PHONY: $(ALL_TARGET_MODULES)
1191 $(ALL_TARGET_MODULES):
1192 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1193 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1194 r=`pwd`; export r; \
1195 s=`cd $(srcdir); pwd`; export s; \
1197 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1202 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1203 # To build a target install-X means to cd to X and make install.
1204 .PHONY: $(CHECK_TARGET_MODULES)
1205 $(CHECK_TARGET_MODULES):
1206 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1207 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1208 r=`pwd`; export r; \
1209 s=`cd $(srcdir); pwd`; export s; \
1211 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1216 # This rule is used to install the modules which use
1217 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1219 .PHONY: $(INSTALL_TARGET_MODULES)
1220 $(INSTALL_TARGET_MODULES): installdirs
1221 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1222 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1223 r=`pwd`; export r; \
1224 s=`cd $(srcdir); pwd`; export s; \
1226 (cd $(TARGET_SUBDIR)/$${dir}; \
1227 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1232 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1233 # To build a target all-X means to cd to X and make all.
1234 .PHONY: $(ALL_X11_MODULES)
1236 @dir=`echo $@ | sed -e 's/all-//'`; \
1237 if [ -f ./$${dir}/Makefile ] ; then \
1238 r=`pwd`; export r; \
1239 s=`cd $(srcdir); pwd`; export s; \
1242 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1247 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1248 # To build a target check-X means to cd to X and make all.
1249 .PHONY: $(CHECK_X11_MODULES)
1250 $(CHECK_X11_MODULES):
1251 @dir=`echo $@ | sed -e 's/check-//'`; \
1252 if [ -f ./$${dir}/Makefile ] ; then \
1253 r=`pwd`; export r; \
1254 s=`cd $(srcdir); pwd`; export s; \
1257 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1262 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1263 # To build a target install-X means to cd to X and make install.
1264 .PHONY: $(INSTALL_X11_MODULES)
1265 $(INSTALL_X11_MODULES): installdirs
1266 @dir=`echo $@ | sed -e 's/install-//'`; \
1267 if [ -f ./$${dir}/Makefile ] ; then \
1268 r=`pwd`; export r; \
1269 s=`cd $(srcdir); pwd`; export s; \
1272 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1277 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1280 @if [ -f ./gcc/Makefile ] ; then \
1281 r=`pwd`; export r; \
1282 s=`cd $(srcdir); pwd`; export s; \
1284 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1289 # Building GCC uses some tools for rebuilding "source" files
1290 # like texinfo, bison/byacc, etc. So we must depend on those.
1292 # While building GCC, it may be necessary to run various target
1293 # programs like the assembler, linker, etc. So we depend on
1296 # In theory, on an SMP all those dependencies can be resolved
1299 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap3 bootstrap4
1300 bootstrap bootstrap-lean bootstrap2 bootstrap3 bootstrap4: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1301 @r=`pwd`; export r; \
1302 s=`cd $(srcdir); pwd`; export s; \
1304 echo "Bootstrapping the compiler"; \
1305 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1306 @r=`pwd`; export r; \
1307 s=`cd $(srcdir); pwd`; export s; \
1309 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1310 compare=compare3 ;; \
1311 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1312 compare=compare-lean ;; \
1313 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1314 compare=compare ;; \
1318 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1319 @echo "Building runtime libraries"; \
1323 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1324 @r=`pwd`; export r; \
1325 s=`cd $(srcdir); pwd`; export s; \
1327 echo "Building the C and C++ compiler"; \
1328 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1329 @echo "Building runtime libraries"; \
1330 $(MAKE) all LANGUAGES="c c++"
1334 @if [ -f ./gcc/Makefile ] ; then \
1335 r=`pwd`; export r; \
1336 s=`cd $(srcdir); pwd`; export s; \
1338 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1345 @if [ -f ./gcc/Makefile ] ; then \
1346 r=`pwd`; export r; \
1347 s=`cd $(srcdir); pwd`; export s; \
1349 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1354 .PHONY: install-gcc-cross
1356 @if [ -f ./gcc/Makefile ] ; then \
1357 r=`pwd`; export r; \
1358 s=`cd $(srcdir); pwd`; export s; \
1360 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1364 # EXPERIMENTAL STUFF
1365 # This rule is used to install the modules which use FLAGS_TO_PASS.
1366 # To build a target install-X means to cd to X and make install.
1367 .PHONY: install-dosrel
1368 install-dosrel: installdirs info
1369 @dir=`echo $@ | sed -e 's/install-//'`; \
1370 if [ -f ./$${dir}/Makefile ] ; then \
1371 r=`pwd`; export r; \
1372 s=`cd $(srcdir); pwd`; export s; \
1374 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1379 install-dosrel-fake:
1382 # This is a list of inter-dependencies among modules.
1384 all-autoconf: all-m4 all-texinfo
1388 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc
1389 all-bison: all-texinfo
1393 all-dejagnu: all-tcl all-expect all-tk
1394 all-diff: all-libiberty
1396 all-emacs19: all-bison all-byacc
1398 configure-target-examples: $(ALL_GCC)
1399 all-target-examples: configure-target-examples
1400 all-expect: all-tcl all-tk
1401 all-fileutils: all-libiberty
1404 all-flex: all-libiberty all-bison all-byacc
1405 all-gas: all-libiberty all-opcodes all-bfd
1409 all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1410 GDB_TK = all-tk all-tcl all-itcl all-tix
1411 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1413 configure-target-gperf: $(ALL_GCC)
1414 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libg++
1415 all-gprof: all-libiberty all-bfd all-opcodes
1416 all-grep: all-libiberty
1417 all-grez: all-libiberty all-bfd all-opcodes
1418 all-gui: all-gdb all-libproc all-target-librx
1420 all-gzip: all-libiberty
1421 all-hello: all-libiberty
1423 all-inet: all-tcl all-send-pr all-perl
1424 all-ispell: all-emacs19
1425 all-itcl: all-tcl all-tk
1426 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex
1427 configure-target-libg++: $(ALL_GCC) configure-target-librx
1428 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++
1429 configure-target-libgloss: $(ALL_GCC)
1430 all-target-libgloss: configure-target-libgloss configure-target-newlib
1431 configure-target-libio: $(ALL_GCC)
1432 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1433 check-target-libio: all-target-libstdc++
1435 configure-target-librx: $(ALL_GCC) configure-target-newlib
1436 all-target-librx: configure-target-librx
1437 configure-target-libstdc++: $(ALL_GCC)
1438 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1439 all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1440 all-m4: all-libiberty
1441 all-make: all-libiberty
1443 configure-target-newlib: $(ALL_GCC)
1444 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1445 all-opcodes: all-bfd all-libiberty
1446 all-patch: all-libiberty
1448 all-prms: all-libiberty
1451 all-recode: all-libiberty
1452 all-sed: all-libiberty
1453 all-send-pr: all-prms
1455 all-sim: all-libiberty all-bfd all-opcodes
1456 all-sn: all-tcl all-tk all-itcl all-db all-grep
1457 all-tar: all-libiberty
1459 all-tclX: all-tcl all-tk
1461 all-texinfo: all-libiberty
1463 all-tgas: all-libiberty all-bfd all-opcodes
1465 all-tix: all-tcl all-tk
1467 all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup
1468 configure-target-winsup: configure-target-newlib
1469 all-uudecode: all-libiberty
1470 configure-target-libiberty: $(ALL_GCC)
1471 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1472 all-target: $(ALL_TARGET_MODULES)
1473 install-target: $(INSTALL_TARGET_MODULES)
1475 ### other supporting targets
1481 installdirs: mkinstalldirs
1482 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1484 dir.info: do-install-info
1485 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1486 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1487 mv -f dir.info.new dir.info ; \
1492 @echo "Building a full distribution of this tree isn't done"
1493 @echo "via 'make dist'. Check out the etc/ subdirectory"
1497 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1498 # ability to use several tags files at once, so there is probably no need
1499 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1500 # (if we felt like it) have this Makefile write a piece of elisp which
1501 # the user could load to tell emacs19 where all the TAGS files we just
1505 # with the gnu make, this is done automatically.
1507 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1508 $(SHELL) ./config.status
1511 # Support for building net releases
1513 # Files in devo used in any net release.
1514 # ChangeLog omitted because it may refer to files which are not in this
1515 # distribution (perhaps it would be better to include it anyway).
1516 DEVO_SUPPORT= README Makefile.in configure configure.in \
1517 config.guess config.sub config move-if-change \
1518 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1519 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1520 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1522 # Files in devo/etc used in any net release.
1523 # ChangeLog omitted because it may refer to files which are not in this
1524 # distribution (perhaps it would be better to include it anyway).
1525 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1526 make-stds.texi standards.info*
1528 # When you use `make setup-dirs' or `make taz' you should always redefine
1530 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1534 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1535 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1536 # Take out texinfo from a few places; make simple BISON=bison line.
1537 sed -e '/^all\.normal: /s/\all-texinfo //' \
1538 -e '/^ install-texinfo /d' \
1540 mv -f tmp Makefile.in
1543 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1544 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1545 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1546 # Make links, and run "make diststuff" or "make info" when needed.
1547 rm -rf proto-toplev ; mkdir proto-toplev
1548 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1549 for d in $$dirs ; do \
1550 if [ -d $$d ]; then \
1551 if [ ! -f $$d/Makefile ] ; then true ; \
1552 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1553 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1554 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1555 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1557 if [ -d $$d/proto-$$d.dir ]; then \
1558 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1560 ln -s ../$$d proto-toplev/$$d ; \
1562 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1564 cd etc ; $(MAKE) info
1567 mkdir proto-toplev/etc
1568 (cd proto-toplev/etc; \
1569 for i in $(ETC_SUPPORT); do \
1570 ln -s ../../etc/$$i . ; \
1573 # Take out texinfo from configurable dirs
1574 rm proto-toplev/configure.in
1575 sed -e '/^host_tools=/s/texinfo //' \
1576 <configure.in >proto-toplev/configure.in
1578 mkdir proto-toplev/texinfo
1579 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1580 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1581 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1582 if test -r texinfo/util/tex3patch ; then \
1583 mkdir proto-toplev/texinfo/util && \
1584 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1586 chmod og=u `find . -print`
1587 if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1588 ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
1590 ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1592 $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
1595 echo "==> Making $(TOOL)-$(VER).tar.gz"
1596 -rm -f $(TOOL)-$(VER)
1597 ln -s proto-toplev $(TOOL)-$(VER)
1598 tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1599 $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1601 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1602 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1605 GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1606 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1607 $(MAKE) -f Makefile.in taz TOOL=gas \
1608 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1610 # The FSF "binutils" release includes gprof and ld.
1611 .PHONY: binutils.tar.gz
1612 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1613 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1614 $(MAKE) -f Makefile.in taz TOOL=binutils \
1615 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1617 .PHONY: gas+binutils.tar.gz
1618 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1619 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1620 $(MAKE) -f Makefile.in taz TOOL=gas \
1621 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1623 .PHONY: libg++.tar.gz
1624 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1625 libg++.tar.gz: $(DIST_SUPPORT) libg++
1626 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1627 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1629 GNATS_SUPPORT_DIRS=include libiberty send-pr
1630 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1631 $(MAKE) -f Makefile.in taz TOOL=gnats \
1632 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1635 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1636 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1637 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1638 $(MAKE) -f Makefile.in taz TOOL=gdb \
1639 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1641 .PHONY: newlib.tar.gz
1642 NEWLIB_SUPPORT_DIRS=libgloss
1643 # taz configures for the sun4 target which won't configure newlib.
1644 # We need newlib configured so that the .info files are made.
1645 # Unfortunately, it is not enough to just configure newlib separately:
1646 # taz will build the .info files but since SUBDIRS won't contain newlib,
1647 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1648 # used in building the .info files, eg: *.def, *.ref).
1649 # The problem isn't solvable however without a lot of extra work because
1650 # target libraries are built in subdir $(target_alias) which gets nuked during
1651 # the make distclean. For now punt on the issue of shipping newlib info files
1652 # with newlib net releases and wait for a day when some native target (sun4?)
1653 # supports newlib (if only minimally).
1654 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1655 $(MAKE) -f Makefile.in taz TOOL=newlib \
1656 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1657 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1663 # end of Makefile.in