* Makefile.tpl: Revert HJL's change.
[deliverable/binutils-gdb.git] / Makefile.tpl
index bc467ce6c3ac74ae130bc1a65f4ddc9e50636b1c..d4edeed1e07cd1dea72bf2ff7a61a87779cdbd75 100644 (file)
@@ -1,4 +1,4 @@
-[+ AutoGen5 template
+[+ AutoGen5 template -*- Mode: Makefile -*-
 in
 +]
 
@@ -72,7 +72,8 @@ includedir = @includedir@
 oldincludedir = @oldincludedir@
 infodir = @infodir@
 mandir = @mandir@
-gxx_include_dir=@gxx_include_dir@
+gxx_include_dir = @gxx_include_dir@
+libstdcxx_incdir = @libstdcxx_incdir@
 
 tooldir = @tooldir@
 build_tooldir = @build_tooldir@
@@ -109,22 +110,19 @@ INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
 INSTALL_SCRIPT = $(INSTALL)
 INSTALL_DATA = $(INSTALL) -m 644
 
-INSTALL_DOSREL = install-dosrel-fake
-
 AS = @AS@
 AR = @AR@
 AR_FLAGS = rc
-CC = cc
+CC = @CC@
 
 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
 # here so that they can be overridden by Makefile fragments.
-HOST_CC = $(CC_FOR_BUILD)
+BUILD_CC = $(CC_FOR_BUILD)
 BUILD_PREFIX = @BUILD_PREFIX@
 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
 
-# These flag values are normally overridden by the configure script.
-CFLAGS = -g
-CXXFLAGS = -g -O2
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
 
 LDFLAGS = 
 LIBCFLAGS = $(CFLAGS)
@@ -139,7 +137,7 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 PICFLAG = 
 PICFLAG_FOR_TARGET = 
 
-CXX = c++
+CXX = @CXX@
 
 # Use -O2 to stress test the compiler.
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
@@ -224,14 +222,18 @@ TARGET_SUBDIR = @target_subdir@
 BUILD_CONFIGDIRS = libiberty
 BUILD_SUBDIR = @build_subdir@
 
-# This is set by the configure script to the arguments to use when configuring
-# directories built for the target.
-TARGET_CONFIGARGS = @target_configargs@
-
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
 BUILD_CONFIGARGS = @build_configargs@
 
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the host system.
+HOST_CONFIGARGS = @host_configargs@
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the target.
+TARGET_CONFIGARGS = @target_configargs@
+
 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
 # was used.
 SET_LIB_PATH = @SET_LIB_PATH@
@@ -254,26 +256,13 @@ TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
 REALLY_SET_LIB_PATH = \
   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
-ALL = all.normal
-INSTALL_TARGET = installdirs \
-       install-gcc \
-       $(INSTALL_MODULES) \
-       $(INSTALL_TARGET_MODULES) \
-       $(INSTALL_X11_MODULES) \
-       $(INSTALL_DOSREL)
-
-INSTALL_TARGET_CROSS = installdirs \
-       install-gcc-cross \
-       $(INSTALL_MODULES) \
-       $(INSTALL_TARGET_MODULES) \
-       $(INSTALL_X11_MODULES) \
-       $(INSTALL_DOSREL)
-
 # Should be substed by configure.in
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 CC_FOR_TARGET = @CC_FOR_TARGET@
 CXX_FOR_TARGET = @CXX_FOR_TARGET@
+RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
+RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
@@ -382,13 +371,6 @@ USUAL_NM_FOR_TARGET = ` \
 all: all.normal
 .PHONY: all
 
-# These can be overridden by config/mt-*.
-# The _TARGET_ is because they're specified in mt-foo.
-# The _HOST_ is because they're programs that run on the host.
-EXTRA_TARGET_HOST_ALL_MODULES =
-EXTRA_TARGET_HOST_INSTALL_MODULES =
-EXTRA_TARGET_HOST_CHECK_MODULES =
-
 #### host and target specific makefile fragments come in here.
 ###
 
@@ -463,7 +445,8 @@ BASE_FLAGS_TO_PASS = \
 # so we pass these variables down unchanged.  They must not contain
 # single nor double quotes.
 RECURSE_FLAGS = \
-       CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+       CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
+       RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
@@ -526,7 +509,7 @@ EXTRA_GCC_FLAGS = \
        'CC=$(CC)' \
        'CXX=$(CXX)' \
        'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
-       'HOST_CC=$(CC_FOR_BUILD)' \
+       'BUILD_CC=$(CC_FOR_BUILD)' \
        'BUILD_PREFIX=$(BUILD_PREFIX)' \
        'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
        'NM=$(NM)' \
@@ -546,104 +529,38 @@ EXTRA_GCC_FLAGS = \
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
 
-# This is a list of the targets for all of the modules which are compiled
-# using the build machine's native compiler.  Configure edits the second
-# macro for build!=host builds.
-ALL_BUILD_MODULES_LIST = \
-       all-build-libiberty
-ALL_BUILD_MODULES = @all_build_modules@
-
-# This is a list of the configure targets for all of the modules which
-# are compiled using the native tools.
-CONFIGURE_BUILD_MODULES = \
-       configure-build-libiberty
-
-# This is a list of the targets for all of the modules which are compiled
-# using $(FLAGS_TO_PASS).
-ALL_MODULES = [+ FOR host_modules +][+ IF with_x +][+ ELSE with_x +]\
-       all-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]\
-       $(EXTRA_TARGET_HOST_ALL_MODULES)
-
-# This is a list of the check targets for all of the modules which are
-# compiled using $(FLAGS_TO_PASS).
-#
-# The list is in two parts.  The first lists those tools which
-# are tested as part of the host's native tool-chain, and not
-# tested in a cross configuration.
-NATIVE_CHECK_MODULES = \
-       check-bison \
-       check-byacc \
-       check-fastjar \
-       check-flex \
-       check-zip
-
-CROSS_CHECK_MODULES = [+ FOR host_modules +][+ IF no_check  +][+ ELIF no_check_cross +][+ ELIF with_x +][+ ELSE check +]\
-       check-[+module+] [+ ENDIF no_check +][+ ENDFOR host_modules +]\
-       $(EXTRA_TARGET_HOST_CHECK_MODULES)
-
-CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
-
-# This is a list of the install targets for all of the modules which are
-# compiled using $(FLAGS_TO_PASS).
-INSTALL_MODULES = [+ FOR host_modules+][+ IF no_install +][+ ELIF with_x +][+ ELSE install +]\
-       install-[+module+] [+ ENDIF no_install +][+ ENDFOR host_modules +]\
-       $(EXTRA_TARGET_HOST_INSTALL_MODULES)
-
-# This is a list of the targets for all of the modules which are compiled
-# using $(X11_FLAGS_TO_PASS).
-ALL_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
-       all-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
-
-# This is a list of the check targets for all of the modules which are
-# compiled using $(X11_FLAGS_TO_PASS).
-CHECK_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
-       check-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
-
-# This is a list of the install targets for all the modules which are
-# compiled using $(X11_FLAGS_TO_PASS).
-INSTALL_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
-       install-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
-
-# This is a list of the targets for all of the modules which are compiled
-# using $(TARGET_FLAGS_TO_PASS).
-ALL_TARGET_MODULES = [+ FOR target_modules +]\
-       all-target-[+module+] [+ ENDFOR target_modules +]
-
-# This is a list of the configure targets for all of the modules which
-# are compiled using the target tools.
-CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
-       configure-target-[+module+] [+ ENDFOR target_modules +]
-
-# This is a list of the check targets for all of the modules which are
-# compiled using $(TARGET_FLAGS_TO_PASS).
-CHECK_TARGET_MODULES = [+ FOR target_modules +][+ IF no_check +][+ ELSE check +]\
-       check-target-[+module+] [+ ENDIF no_check +][+ ENDFOR target_modules +]
-
-# This is a list of the install targets for all of the modules which are
-# compiled using $(TARGET_FLAGS_TO_PASS).
-INSTALL_TARGET_MODULES = [+ FOR target_modules +][+ IF no_install +][+ ELSE install +]\
-       install-target-[+module+] [+ ENDIF no_install +][+ ENDFOR target_modules +]
+configure-host: @configure_host_modules@
+configure-target: @configure_target_modules@
 
 # This is a list of the targets for which we can do a clean-{target}.
-CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELIF with_x +][+ ELSE clean +]\
-       clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
+CLEAN_MODULES =[+
+    FOR host_modules +][+
+        IF (not (or (exist? "no_clean") (exist? "with_x"))) +] \
+       clean-[+module+][+
+        ENDIF no_clean +][+
+    ENDFOR host_modules +]
 
 # All of the target modules that can be cleaned
-CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
-       clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
+CLEAN_TARGET_MODULES =[+
+    FOR target_modules +][+
+        IF (not (exist? "no_clean")) +] \
+       clean-target-[+module+][+
+        ENDIF no_clean +][+
+    ENDFOR target_modules +]
 
 # All of the x11 modules that can be cleaned
 CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
        clean-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
 
 # The target built for a native build.
+# This list only includes modules actually being configured and built.
 .PHONY: all.normal
-all.normal: \
-       $(ALL_BUILD_MODULES) \
-       $(ALL_MODULES) \
-       $(ALL_X11_MODULES) \
-       $(ALL_TARGET_MODULES) \
-       all-gcc
+all.normal: @all_build_modules@ \
+       @all_host_modules@ \
+       @all_target_modules@
+
+all-host: @all_host_modules@
+all-target: @all_target_modules@
 
 # Do a target for all the subdirectories.  A ``make do-X'' will do a
 # ``make X'' in all subdirectories (because, in general, there is a
@@ -711,8 +628,9 @@ info: do-info
 installcheck: do-installcheck
 dvi: do-dvi
 
-# Make sure makeinfo is built before we do a `make info'.
-do-info: all-texinfo
+# Make sure makeinfo is built before we do a `make info', if we're
+# in fact building texinfo.
+do-info: maybe-all-texinfo
 
 install-info: do-install-info dir.info
        s=`cd $(srcdir); ${PWD}`; export s; \
@@ -784,10 +702,9 @@ clean-target-libgcc:
 check:
        $(MAKE) do-check NOTPARALLEL=parallel-ok
 
-do-check: $(CHECK_MODULES) \
-       $(CHECK_TARGET_MODULES) \
-       $(CHECK_X11_MODULES) \
-       check-gcc
+# Only include modules actually being configured and built.
+do-check: @check_host_modules@ \
+       @check_target_modules@
 
 # Automated reporting of test results.
 
@@ -812,28 +729,14 @@ mail-report-with-warnings.log: warning.log
 
 # Installation targets.
 
-.PHONY: install install-cross uninstall source-vault binary-vault vault-install
-install: $(INSTALL_TARGET) 
-install-cross: $(INSTALL_TARGET_CROSS) 
+.PHONY: install uninstall
+install: installdirs @install_host_modules@ @install_target_modules@
+
+install-target: @install_target_modules@
 
 uninstall:
        @echo "the uninstall target is not supported in this tree"
 
-source-vault:
-       $(MAKE) -f ./release/Build-A-Release \
-               host=$(host_alias) source-vault
-
-binary-vault:
-       $(MAKE) -f ./release/Build-A-Release \
-               host=$(host_alias) target=$(target_alias)
-
-vault-install:
-       @if [ -f ./release/vault-install ] ; then \
-         ./release/vault-install $(host_alias) $(target_alias) ; \
-       else \
-         true ; \
-       fi
-
 .PHONY: install.all
 install.all: install-no-fixedincludes
        @if [ -f ./gcc/Makefile ] ; then \
@@ -848,56 +751,49 @@ install.all: install-no-fixedincludes
 # install-no-fixedincludes is used because Cygnus can not distribute
 # the fixed header files.
 .PHONY: install-no-fixedincludes
-install-no-fixedincludes: \
-       installdirs \
-       $(INSTALL_MODULES) \
-       $(INSTALL_TARGET_MODULES) \
-       $(INSTALL_X11_MODULES) \
-       gcc-no-fixedincludes 
+install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \
+       @install_target_modules@ gcc-no-fixedincludes
 
-# Install the gcc headers files, but not the fixed include files,
-# which Cygnus is not allowed to distribute.  This rule is very
-# dependent on the workings of the gcc Makefile.in.
-.PHONY: gcc-no-fixedincludes
-gcc-no-fixedincludes:
-       @if [ -f ./gcc/Makefile ]; then \
-         rm -rf gcc/tmp-include; \
-         mv gcc/include gcc/tmp-include 2>/dev/null; \
-         mkdir gcc/include; \
-         cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
-         touch gcc/stmp-fixinc gcc/include/fixed; \
-         rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}` ; export s; \
-         $(SET_LIB_PATH) \
-         (cd ./gcc; \
-          $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
-         rm -rf gcc/include; \
-         mv gcc/tmp-include gcc/include 2>/dev/null; \
-       else true; fi
+### other supporting targets
 
-# These rules are used to build the modules which are built with the
-# build machine's native compiler.
-[+ FOR build_modules +]
-.PHONY: all-build-[+module+]
-all-build-[+module+]:
-       @if [ -f ./[+module+]/Makefile ] ; then \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
-         (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all); \
-       else \
-         true; \
+MAKEDIRS= \
+       $(DESTDIR)$(prefix) \
+       $(DESTDIR)$(exec_prefix)
+.PHONY: installdirs
+installdirs: mkinstalldirs
+       $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
+
+dir.info: do-install-info
+       if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
+         $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
+         mv -f dir.info.new dir.info ; \
+       else true ; \
        fi
 
-.PHONY: configure-build-[+module+]
-configure-build-[+module+]:
-       @if [ ! -d $(BUILD_SUBDIR) ]; then \
-         true; \
-       elif [ -f $(BUILD_SUBDIR)/[+module+]/Makefile ] ; then \
-         true; \
-       elif echo " $(BUILD_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
-         if [ -d $(srcdir)/[+module+] ]; then \
-           [ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\
+dist:
+       @echo "Building a full distribution of this tree isn't done"
+       @echo "via 'make dist'.  Check out the etc/ subdirectory" 
+
+etags tags: TAGS
+
+# Right now this just builds TAGS in each subdirectory.  emacs19 has the
+# ability to use several tags files at once, so there is probably no need
+# to combine them into one big TAGS file (like CVS 1.3 does).  We could
+# (if we felt like it) have this Makefile write a piece of elisp which
+# the user could load to tell emacs19 where all the TAGS files we just
+# built are.
+TAGS: do-TAGS
+
+
+# --------------------------------------
+# Modules which run on the build machine
+# --------------------------------------
+[+ FOR build_modules +]
+.PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
+maybe-configure-build-[+module+]:
+configure-build-[+module+]: $(BUILD_SUBDIR)/[+module+]/Makefile
+$(BUILD_SUBDIR)/[+module+]/Makefile: config.status
+       @[ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\
            r=`${PWD}`; export r; \
            s=`cd $(srcdir); ${PWD}`; export s; \
            AR="$(AR_FOR_BUILD)"; export AR; \
@@ -948,127 +844,153 @@ configure-build-[+module+]:
              srcdiroption="--srcdir=$${topdir}/[+module+]"; \
              libsrcdir="$$s/[+module+]"; \
            fi; \
-           if [ -f $${libsrcdir}/configure ] ; then \
-             rm -f no-such-file skip-this-dir; \
-             CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-               $(BUILD_CONFIGARGS) $${srcdiroption} \
-               --with-build-subdir="$(BUILD_SUBDIR)"; \
-           else \
-             rm -f no-such-file skip-this-dir; \
-             CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
-               $(BUILD_CONFIGARGS) $${srcdiroption} \
-               --with-build-subdir="$(BUILD_SUBDIR)"; \
-           fi || exit 1; \
-           if [ -f skip-this-dir ] ; then \
-             sh skip-this-dir; \
-             rm -f skip-this-dir; \
-             cd ..; rmdir [+module+] || true; \
-           else \
-             true; \
-           fi; \
-         else \
-           true; \
-         fi; \
-       else \
-         true; \
-       fi
+           rm -f no-such-file || : ; \
+           CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+             $(BUILD_CONFIGARGS) $${srcdiroption} \
+             --with-build-subdir="$(BUILD_SUBDIR)" \
+             || exit 1
+
+.PHONY: all-build-[+module+] maybe-all-build-[+module+]
+maybe-all-build-[+module+]:
+all-build-[+module+]: configure-build-[+module+]
+       @r=`${PWD}`; export r; \
+         s=`cd $(srcdir); ${PWD}`; export s; \
+         (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
 [+ ENDFOR build_modules +]
 
-# This rule is used to build the modules which use FLAGS_TO_PASS.  To
-# build a target all-X means to cd to X and make all.
-.PHONY: $(ALL_MODULES)
-$(ALL_MODULES):
-       @dir=`echo $@ | sed -e 's/all-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
-         $(SET_LIB_PATH) \
-         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
-       else \
-         true; \
-       fi
+# --------------------------------------
+# Modules which run on the host machine
+# --------------------------------------
+[+ FOR host_modules +]
+.PHONY: configure-[+module+] maybe-configure-[+module+]
+maybe-configure-[+module+]:
+configure-[+module+]: [+module+]/Makefile
 
-# These rules are used to check the modules which use FLAGS_TO_PASS.
-# To build a target check-X means to cd to X and make check.  Some
-# modules are only tested in a native toolchain.
+[+module+]/Makefile: config.status
+       @[ -d [+module+] ] || mkdir [+module+]; \
+       r=`${PWD}`; export r; \
+       s=`cd $(srcdir); ${PWD}`; export s; \
+       CC="$(CC)"; export CC; \
+       CFLAGS="$(CFLAGS)"; export CFLAGS; \
+       CXX="$(CXX)"; export CXX; \
+       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+       if [ z$(build_canonical) !=  z$(host_canoncial) ] ; then \
+         AR="$(AR)"; export AR; \
+         AS="$(AS)"; export AS; \
+         CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+         DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+         LD="$(LD)"; export LD; \
+         NM="$(NM)"; export NM; \
+         RANLIB="$(RANLIB)"; export RANLIB; \
+         WINDRES="$(WINDRES)"; export WINDRES; \
+         OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+         OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       fi; \
+       echo Configuring in [+module+]; \
+       cd [+module+] || exit 1; \
+       case $(srcdir) in \
+         \.) \
+           srcdiroption="--srcdir=."; \
+           libsrcdir=".";; \
+         /* | [A-Za-z]:[\\/]*) \
+           srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
+           libsrcdir="$$s/[+module+]";; \
+         *) \
+           srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
+           libsrcdir="$$s/[+module+]";; \
+       esac; \
+       $(SHELL) $${libsrcdir}/configure \
+         $(HOST_CONFIGARGS) $${srcdiroption} \
+         || exit 1
 
-.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
-$(NATIVE_CHECK_MODULES):
+.PHONY: all-[+module+] maybe-all-[+module+]
+maybe-all-[+module+]:
+all-[+module+]: configure-[+module+]
+       @r=`${PWD}`; export r; \
+         s=`cd $(srcdir); ${PWD}`; export s; \
+         $(SET_LIB_PATH) \
+         (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
+           IF with_x 
+             +] $(X11_FLAGS_TO_PASS)[+ 
+           ENDIF with_x +] all)
+
+[+ IF no_check +]
+.PHONY: check-[+module+]
+check-[+module+]:
+[+ ELIF no_check_cross +]
+.PHONY: check-[+module+]
+# This module is only tested in a native toolchain.
+check-[+module+]:
        @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
-         dir=`echo $@ | sed -e 's/check-//'`; \
-         if [ -f ./$${dir}/Makefile ] ; then \
            r=`${PWD}`; export r; \
            s=`cd $(srcdir); ${PWD}`; export s; \
            $(SET_LIB_PATH) \
-           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
-         else \
-           true; \
-         fi; \
+           (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
+             IF with_x 
+               +] $(X11_FLAGS_TO_PASS)[+ 
+             ENDIF with_x +] check); \
        fi
-
-$(CROSS_CHECK_MODULES):
-       @dir=`echo $@ | sed -e 's/check-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
-         r=`${PWD}`; export r; \
+[+ ELSE check +]
+.PHONY: check-[+module+]
+check-[+module+]:
+       @r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
-         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
-       else \
-         true; \
-       fi
+         (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
+           IF with_x 
+             +] $(X11_FLAGS_TO_PASS)[+ 
+           ENDIF with_x +] check)
+[+ ENDIF no_check +]
 
-# This rule is used to install the modules which use FLAGS_TO_PASS.
-# To build a target install-X means to cd to X and make install.
-.PHONY: $(INSTALL_MODULES)
-$(INSTALL_MODULES): installdirs
-       @dir=`echo $@ | sed -e 's/install-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
-         r=`${PWD}`; export r; \
+[+ IF no_install +]
+.PHONY: install-[+module+] maybe-install-[+module+]
+maybe-install-[+module+]:
+install-[+module+]:
+[+ ELSE install +]
+.PHONY: install-[+module+] maybe-install-[+module+]
+maybe-install-[+module+]:
+install-[+module+]: installdirs
+       @r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
-         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
-       else \
-         true; \
-       fi
+         (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
+           IF with_x 
+             +] $(X11_FLAGS_TO_PASS)[+ 
+           ENDIF with_x +] install)
+[+ ENDIF no_install +]
+[+ ENDFOR host_modules +]
 
-# These rules are used to build the modules which are built with the target
-# tools.  To make foo-X means to cd to X and make foo.
+# ---------------------------------------
+# Modules which run on the target machine
+# ---------------------------------------
 [+ FOR target_modules +]
-.PHONY: configure-target-[+module+]
-configure-target-[+module+]:
-       @if [ -d $(TARGET_SUBDIR)/[+module+] ]; then \
-         r=`${PWD}`; export r; \
-         $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/tmpmulti.out 2> /dev/null; \
-         if [ -s $(TARGET_SUBDIR)/[+module+]/tmpmulti.out ]; then \
-           if [ -f $(TARGET_SUBDIR)/[+module+]/multilib.out ]; then \
-             if cmp $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/tmpmulti.out > /dev/null; then \
-               rm -f $(TARGET_SUBDIR)/[+module+]/tmpmulti.out; \
-             else \
-               echo "Multilibs changed for [+module+], reconfiguring"; \
-               rm -f $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/Makefile; \
-               mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
-             fi; \
-           else \
-             mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
-           fi; \
-         fi; \
-       fi; exit 0      # break command into two pieces
-       @dir=[+module+] ; \
-       if [ ! -d $(TARGET_SUBDIR) ]; then \
-         true; \
-       elif [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
-         true; \
-       elif echo " $(TARGET_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
-         if [ -d $(srcdir)/[+module+] ]; then \
-           [ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
+.PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
+maybe-configure-target-[+module+]:
+configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/Makefile
+
+# Don't manually override CC_FOR_TARGET at make time; get it set right
+# at configure time.  Otherwise multilibs may be wrong.
+$(TARGET_SUBDIR)/[+module+]/multilib.out: maybe-all-gcc
+       @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
+       r=`${PWD}`; export r; \
+       echo "Configuring multilibs for [+module+]"; \
+       $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/multilib.out 2> /dev/null
+
+$(TARGET_SUBDIR)/[+module+]/Makefile: config.status $(TARGET_SUBDIR)/[+module+]/multilib.out
+       @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
            r=`${PWD}`; export r; \
            s=`cd $(srcdir); ${PWD}`; export s; \
            $(SET_LIB_PATH) \
            AR="$(AR_FOR_TARGET)"; export AR; \
            AS="$(AS_FOR_TARGET)"; export AS; \
            CC="$(CC_FOR_TARGET)"; export CC; \
-           CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-           CXX="$(CXX_FOR_TARGET)"; export CXX; \
+           CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \[+ 
+       IF raw_cxx +]
+           CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+           CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ 
+       ELSE normal_cxx +]
+           CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ 
+       ENDIF raw_cxx +]
            CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
            GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
            DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
@@ -1112,128 +1034,124 @@ configure-target-[+module+]:
              srcdiroption="--srcdir=$${topdir}/[+module+]"; \
              libsrcdir="$$s/[+module+]"; \
            fi; \
-           if [ -f $${libsrcdir}/configure ] ; then \
-             rm -f no-such-file skip-this-dir; \
-             CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-               $(TARGET_CONFIGARGS) $${srcdiroption} \
-               --with-target-subdir="$(TARGET_SUBDIR)"; \
-           else \
-             rm -f no-such-file skip-this-dir; \
-             CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
-               $(TARGET_CONFIGARGS) $${srcdiroption} \
-               --with-target-subdir="$(TARGET_SUBDIR)"; \
-           fi || exit 1; \
-           if [ -f skip-this-dir ] ; then \
-             sh skip-this-dir; \
-             rm -f skip-this-dir; \
-             cd ..; rmdir [+module+] || true; \
-           else \
-             true; \
-           fi; \
-         else \
-           true; \
-         fi; \
-       else \
-         true; \
-       fi
-
-.PHONY: all-target-[+module+]
-all-target-[+module+]:
-       @dir=[+module+] ; \
-       if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
-         r=`${PWD}`; export r; \
+           rm -f no-such-file || : ; \
+           CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+             $(TARGET_CONFIGARGS) $${srcdiroption} \
+             --with-target-subdir="$(TARGET_SUBDIR)" \
+             || exit 1
+
+.PHONY: all-target-[+module+] maybe-all-target-[+module+]
+maybe-all-target-[+module+]:
+all-target-[+module+]: configure-target-[+module+]
+       @r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
          (cd $(TARGET_SUBDIR)/[+module+]; \
-           $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
-       else \
-         true; \
-       fi
-[+ IF no_check +][+ ELSE check +]
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
+              IF raw_cxx 
+                +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
+              ENDIF raw_cxx 
+           +] all)
+[+ IF no_check +]
+# Dummy target for uncheckable module.
 .PHONY: check-target-[+module+]
 check-target-[+module+]:
-       @dir=[+module+] ; \
-       if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
-         r=`${PWD}`; export r; \
+[+ ELSE check +]
+.PHONY: check-target-[+module+]
+check-target-[+module+]:
+       @r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
          (cd $(TARGET_SUBDIR)/[+module+]; \
-           $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
-       else \
-         true; \
-       fi
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
+              IF raw_cxx 
+                +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
+              ENDIF raw_cxx 
+           +] check)
 [+ ENDIF no_check +]
-[+ IF no_install +][+ ELSE install +]\
-.PHONY: install-target-[+module+]
+[+ IF no_install +]
+.PHONY: install-target-[+module+] maybe-install-target-[+module+]
+maybe-install-target-[+module+]:
+# Dummy target for uninstallable.
+install-target-[+module+]:
+[+ ELSE install +]
+.PHONY: install-target-[+module+] maybe-install-target-[+module+]
+maybe-install-target-[+module+]:
 install-target-[+module+]: installdirs
-       @dir=[+module+] ; \
-       if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
-         r=`${PWD}`; export r; \
+       @r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
          (cd $(TARGET_SUBDIR)/[+module+]; \
-           $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
-       else \
-         true; \
-       fi
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
 [+ ENDIF no_install +]
 [+ ENDFOR target_modules +]
 
-# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
-# To build a target all-X means to cd to X and make all.
-.PHONY: $(ALL_X11_MODULES)
-$(ALL_X11_MODULES):
-       @dir=`echo $@ | sed -e 's/all-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
-         $(SET_LIB_PATH) \
-         (cd $${dir}; \
-          $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
-       else \
-         true; \
-       fi
+# ----------
+# GCC module
+# ----------
 
-# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
-# To build a target check-X means to cd to X and make all.
-.PHONY: $(CHECK_X11_MODULES)
-$(CHECK_X11_MODULES):
-       @dir=`echo $@ | sed -e 's/check-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
-         $(SET_LIB_PATH) \
-         (cd $${dir}; \
-          $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
-       else \
-         true; \
-       fi
+# Unfortunately, while gcc _should_ be a host module,
+# libgcc is a target module, and gen* programs are
+# build modules.  So GCC is a sort of hybrid.
 
-# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
-# To build a target install-X means to cd to X and make install.
-.PHONY: $(INSTALL_X11_MODULES)
-$(INSTALL_X11_MODULES): installdirs
-       @dir=`echo $@ | sed -e 's/install-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
+# gcc is the only module which uses GCC_FLAGS_TO_PASS.
+.PHONY: configure-gcc maybe-configure-gcc
+maybe-configure-gcc:
+configure-gcc: gcc/Makefile
+
+gcc/Makefile: config.status
+       @[ -d gcc ] || mkdir gcc; \
+       r=`${PWD}`; export r; \
+       s=`cd $(srcdir); ${PWD}`; export s; \
+       CC="$(CC)"; export CC; \
+       CFLAGS="$(CFLAGS)"; export CFLAGS; \
+       CXX="$(CXX)"; export CXX; \
+       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+       if [ z$(build_canonical) !=  z$(host_canoncial) ] ; then \
+         AR="$(AR)"; export AR; \
+         AS="$(AS)"; export AS; \
+         CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+         DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+         LD="$(LD)"; export LD; \
+         NM="$(NM)"; export NM; \
+         RANLIB="$(RANLIB)"; export RANLIB; \
+         WINDRES="$(WINDRES)"; export WINDRES; \
+         OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+         OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       fi; \
+       echo Configuring in gcc; \
+       cd gcc || exit 1; \
+       case $(srcdir) in \
+         \.) \
+           srcdiroption="--srcdir=."; \
+           libsrcdir=".";; \
+         /* | [A-Za-z]:[\\/]*) \
+           srcdiroption="--srcdir=$(srcdir)/gcc"; \
+           libsrcdir="$$s/gcc";; \
+         *) \
+           srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+           libsrcdir="$$s/gcc";; \
+       esac; \
+       $(SHELL) $${libsrcdir}/configure \
+         $(HOST_CONFIGARGS) $${srcdiroption} \
+         || exit 1
+
+# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
+# causes trouble.  This wart will be fixed eventually by moving
+# the bootstrap behavior to this file.
+.PHONY: all-gcc maybe-all-gcc
+maybe-all-gcc:
+all-gcc: configure-gcc
+       @if [ -f gcc/stage_last ] ; then \
          r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
-         (cd $${dir}; \
-          $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
+         (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
        else \
-         true; \
-       fi
-
-# gcc is the only module which uses GCC_FLAGS_TO_PASS.
-.PHONY: all-gcc
-all-gcc:
-       @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
          (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
-       else \
-         true; \
        fi
 
 # Building GCC uses some tools for rebuilding "source" files
@@ -1247,7 +1165,7 @@ all-gcc:
 # in parallel.
 #
 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
-bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap
+bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc
        @r=`${PWD}`; export r; \
        s=`cd $(srcdir); ${PWD}`; export s; \
        $(SET_LIB_PATH) \
@@ -1300,19 +1218,22 @@ check-gcc:
          true; \
        fi
 
-.PHONY: check-c++
-check-c++:
+.PHONY: check-gcc-c++
+check-gcc-c++:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD}`; export r; \
          s=`cd $(srcdir); ${PWD}`; export s; \
          $(SET_LIB_PATH) \
          (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
-         $(MAKE) check-target-libstdc++-v3; \
        else \
          true; \
-       fi 
+       fi
 
-.PHONY: install-gcc
+.PHONY: check-c++
+check-c++: check-target-libstdc++-v3 check-gcc-c++
+
+.PHONY: install-gcc maybe-install-gcc
+maybe-install-gcc:
 install-gcc:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD}`; export r; \
@@ -1323,181 +1244,156 @@ install-gcc:
          true; \
        fi
 
-.PHONY: install-gcc-cross
-install-gcc-cross:
-       @if [ -f ./gcc/Makefile ] ; then \
-         r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
-         $(SET_LIB_PATH) \
-         (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
-       else \
-         true; \
-       fi
-# EXPERIMENTAL STUFF
-# This rule is used to install the modules which use FLAGS_TO_PASS.
-# To build a target install-X means to cd to X and make install.
-.PHONY: install-dosrel
-install-dosrel: installdirs info
-       @dir=`echo $@ | sed -e 's/install-//'`; \
-       if [ -f ./$${dir}/Makefile ] ; then \
+# Install the gcc headers files, but not the fixed include files,
+# which Cygnus is not allowed to distribute.  This rule is very
+# dependent on the workings of the gcc Makefile.in.
+.PHONY: gcc-no-fixedincludes
+gcc-no-fixedincludes:
+       @if [ -f ./gcc/Makefile ]; then \
+         rm -rf gcc/tmp-include; \
+         mv gcc/include gcc/tmp-include 2>/dev/null; \
+         mkdir gcc/include; \
+         cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
+         touch gcc/stmp-fixinc gcc/include/fixed; \
+         rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
          r=`${PWD}`; export r; \
-         s=`cd $(srcdir); ${PWD}`; export s; \
+         s=`cd $(srcdir); ${PWD}` ; export s; \
          $(SET_LIB_PATH) \
-         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
-       else \
-         true; \
-       fi
+         (cd ./gcc; \
+          $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
+         rm -rf gcc/include; \
+         mv gcc/tmp-include gcc/include 2>/dev/null; \
+       else true; fi
 
-install-dosrel-fake:
-
-ALL_GCC = all-gcc
-ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
-ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
-
-# This is a list of inter-dependencies among modules.
-all-ash:
-all-autoconf: all-m4 all-texinfo
-all-automake: all-m4 all-texinfo
-all-bash:
-all-bfd: all-libiberty all-intl
-all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
-all-bison: all-texinfo
-configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
-all-byacc:
-all-bzip2:
-all-db:
-all-dejagnu: all-tcl all-expect all-tk
-all-diff: all-libiberty
-all-etc:
-configure-target-examples: $(ALL_GCC_C)
-all-expect: all-tcl all-tk
-all-fileutils: all-libiberty
-all-findutils:
-all-find:
-all-flex: all-libiberty all-bison all-byacc
-all-gas: all-libiberty all-opcodes all-bfd all-intl
-all-gawk:
-all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
-all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
+# --------------------------------------
+# Dependencies between different modules
+# --------------------------------------
+
+# There are two types of dependencies here: 'hard' dependencies, where one
+# module simply won't build without the other; and 'soft' dependencies, where
+# if the depended-on module is missing, the depending module will do without
+# or find a substitute somewhere (perhaps installed).  Soft dependencies
+# are specified by depending on a 'maybe-' target.  If you're not sure,
+# it's safer to use a soft dependency.
+
+# Host modules specific to gcc.
+# GCC needs to identify certain tools.
+configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
+all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+# This is a slightly kludgy method of getting dependencies on 
+# all-build-libiberty correct; it would be better to build it every time.
+all-gcc: maybe-all-build-libiberty
+all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+
+# Host modules specific to gdb.
+# GDB needs to know that the simulator is being built.
+configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim
 GDB_TK = @GDB_TK@
-all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
-all-gettext:
-all-gnuserv:
-configure-target-gperf: $(ALL_GCC_CXX)
-all-target-gperf: all-target-libiberty all-target-libstdc++-v3
-all-gprof: all-libiberty all-bfd all-opcodes all-intl
-all-grep: all-libiberty
-all-guile:
-all-gzip: all-libiberty
-all-hello: all-libiberty
-all-indent:
-all-intl:
-all-itcl: all-tcl all-tk
-all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
-configure-target-libgloss: $(ALL_GCC)
-all-target-libgloss: configure-target-newlib
-all-libgui: all-tcl all-tk all-itcl
-all-libiberty:
-
-all-build-libiberty: configure-build-libiberty
-
-configure-target-libffi: $(ALL_GCC_C) 
-configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
-all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
-configure-target-libstdc++-v3: $(ALL_GCC_C)
-all-target-libstdc++-v3: all-target-libiberty
-all-libtool:
-configure-target-libf2c: $(ALL_GCC_C)
-all-target-libf2c: all-target-libiberty
-configure-target-libobjc: $(ALL_GCC_C)
-all-target-libobjc: all-target-libiberty
-all-m4: all-libiberty all-texinfo
-all-make: all-libiberty
-all-mmalloc:
-configure-target-newlib: $(ALL_GCC)
-configure-target-libtermcap: $(ALL_GCC_C)
-all-opcodes: all-bfd all-libiberty
-all-patch: all-libiberty
-all-perl:
-all-prms: all-libiberty
-configure-target-qthreads: $(ALL_GCC_C)
-all-rcs:
-all-readline:
-all-recode: all-libiberty
-all-sed: all-libiberty
-all-send-pr: all-prms
-all-shellutils:
-all-sid: all-tcl all-tk
-all-sim: all-libiberty all-bfd all-opcodes all-readline
-all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
-all-tar: all-libiberty
-all-tcl:
-all-tclX: all-tcl all-tk
-all-tk: all-tcl
-all-texinfo: all-libiberty
-all-textutils:
-all-time:
-all-tix: all-tcl all-tk
-all-wdiff:
-configure-target-winsup: $(ALL_GCC_C)
-all-target-winsup: all-target-libiberty all-target-libtermcap
-all-uudecode: all-libiberty
-all-zip:
-all-zlib:
-configure-target-zlib: $(ALL_GCC_C)
-all-fastjar: all-zlib all-libiberty
-configure-target-fastjar: configure-target-zlib
-all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
-configure-target-libiberty: $(ALL_GCC_C)
-configure-target: $(CONFIGURE_TARGET_MODULES)
-all-target: $(ALL_TARGET_MODULES)
-install-target: $(INSTALL_TARGET_MODULES)
-install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
-install-sid: install-tcl install-tk
-
+all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
+install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
+configure-libgui: maybe-configure-tcl maybe-configure-tk
+all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl
+
+# Host modules specific to binutils.
+configure-bfd: configure-libiberty
+all-bfd: maybe-all-libiberty maybe-all-intl
+all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl
 # We put install-opcodes before install-binutils because the installed
 # binutils might be on PATH, and they might need the shared opcodes
 # library.
-install-binutils: install-opcodes
-
+install-binutils: maybe-install-opcodes
+all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl
+all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl
+all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl
+all-opcodes: maybe-all-bfd maybe-all-libiberty
+
+# Other host modules in the 'src' repository.
+all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk
+configure-expect: maybe-configure-tcl maybe-configure-tk
+all-expect: maybe-all-tcl maybe-all-tk
+configure-itcl: maybe-configure-tcl maybe-configure-tk
+all-itcl: maybe-all-tcl maybe-all-tk
 # We put install-tcl before install-itcl because itcl wants to run a
 # program on installation which uses the Tcl libraries.
-install-itcl: install-tcl
-
-
-# Dependencies of all-target-foo on configure-target-foo.
-[+ FOR target_modules +]all-target-[+module+]: configure-target-[+module+]
-[+ ENDFOR target_modules +]
-
-### other supporting targets
+install-itcl: maybe-install-tcl
+all-sid: maybe-all-tcl maybe-all-tk
+install-sid: maybe-install-tcl maybe-install-tk
+all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb
+configure-tk: maybe-configure-tcl
+all-tk: maybe-all-tcl
+configure-tix: maybe-configure-tcl maybe-configure-tk
+all-tix: maybe-all-tcl maybe-all-tk
+all-texinfo: maybe-all-libiberty
+
+# Other host modules.  Warning, these are not well tested.
+all-autoconf: maybe-all-m4 maybe-all-texinfo
+all-automake: maybe-all-m4 maybe-all-texinfo
+all-bison: maybe-all-texinfo
+all-diff: maybe-all-libiberty
+all-fastjar: maybe-all-zlib maybe-all-libiberty
+all-fileutils: maybe-all-libiberty
+all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
+all-grep: maybe-all-libiberty
+all-gzip: maybe-all-libiberty
+all-hello: maybe-all-libiberty
+all-m4: maybe-all-libiberty maybe-all-texinfo
+all-make: maybe-all-libiberty
+all-patch: maybe-all-libiberty
+all-prms: maybe-all-libiberty
+all-recode: maybe-all-libiberty
+all-sed: maybe-all-libiberty
+all-send-pr: maybe-all-prms
+all-snavigator: maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-db maybe-all-grep maybe-all-libgui
+all-tar: maybe-all-libiberty
+all-uudecode: maybe-all-libiberty
+
+ALL_GCC = maybe-all-gcc
+ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss
+ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
+
+# Target modules specific to gcc.
+configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
+configure-target-fastjar: maybe-configure-target-zlib
+all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
+configure-target-libf2c: $(ALL_GCC_C)
+all-target-libf2c: maybe-all-target-libiberty
+configure-target-libffi: $(ALL_GCC_C) 
+configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
+all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
+configure-target-libobjc: $(ALL_GCC_C)
+all-target-libobjc: maybe-all-target-libiberty
+configure-target-libstdc++-v3: $(ALL_GCC_C)
+all-target-libstdc++-v3: maybe-all-target-libiberty
+configure-target-zlib: $(ALL_GCC_C)
 
-MAKEDIRS= \
-       $(DESTDIR)$(prefix) \
-       $(DESTDIR)$(exec_prefix)
-.PHONY: installdirs
-installdirs: mkinstalldirs
-       $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
+# Target modules in the 'src' repository.
+configure-target-examples: $(ALL_GCC_C)
+configure-target-libgloss: $(ALL_GCC)
+all-target-libgloss: maybe-configure-target-newlib
+configure-target-libiberty: $(ALL_GCC_C)
+configure-target-libtermcap: $(ALL_GCC_C)
+configure-target-newlib: $(ALL_GCC)
+configure-target-rda: $(ALL_GCC_C)
+configure-target-winsup: $(ALL_GCC_C)
+all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
 
-dir.info: do-install-info
-       if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
-         $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
-         mv -f dir.info.new dir.info ; \
-       else true ; \
-       fi
+# Other target modules.  Warning, these are not well tested.
+configure-target-gperf: $(ALL_GCC_CXX)
+all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
+configure-target-qthreads: $(ALL_GCC_C)
 
-dist:
-       @echo "Building a full distribution of this tree isn't done"
-       @echo "via 'make dist'.  Check out the etc/ subdirectory" 
+# Dependencies of maybe-foo on foo.  These are used because, for example,
+# all-gcc only depends on all-gas if gas is present and being configured.
+@maybe_dependencies@
 
-etags tags: TAGS
+# Serialization dependencies.  Host configures don't work well in parallel to
+# each other, due to contention over config.cache.  Target configures and 
+# build configures are similar.
+@serialization_dependencies@
 
-# Right now this just builds TAGS in each subdirectory.  emacs19 has the
-# ability to use several tags files at once, so there is probably no need
-# to combine them into one big TAGS file (like CVS 1.3 does).  We could
-# (if we felt like it) have this Makefile write a piece of elisp which
-# the user could load to tell emacs19 where all the TAGS files we just
-# built are.
-TAGS: do-TAGS
+# --------------------------------
+# Regenerating top level configury
+# --------------------------------
 
 # Rebuilding Makefile.in, using autogen.
 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
This page took 0.036842 seconds and 4 git commands to generate.