2004-06-01 Paolo Bonzini <bonzini@gnu.org>
[deliverable/binutils-gdb.git] / Makefile.tpl
index 33764aa40ec948d96a8ece0d709efe4e09d66e4c..e81d036139682cc02dba9d2dd382768c0c567d90 100644 (file)
@@ -6,7 +6,7 @@ in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003 Free Software Foundation
+#   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -111,12 +111,66 @@ BUILD_SUBDIR = @build_subdir@
 # 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 the list of variables to export in the environment when
+# configuring subdirectories for the build system.  It must also be
+# exported whenever recursing into a build directory in case that
+# directory's Makefile re-runs configure.
+BUILD_EXPORTS = \
+       AR="$(AR_FOR_BUILD)"; export AR; \
+       AS="$(AS_FOR_BUILD)"; export AS; \
+       CC="$(CC_FOR_BUILD)"; export CC; \
+       CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+       CXX="$(CXX_FOR_BUILD)"; export CXX; \
+       CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+       GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+       GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+       DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+       LD="$(LD_FOR_BUILD)"; export LD; \
+       LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+       NM="$(NM_FOR_BUILD)"; export NM; \
+       RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+       WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;
 
 # This is the list of directories to built for the host system.
 SUBDIRS = @configdirs@
 # 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 the list of variables to export in the environment when
+# configuring subdirectories for the host system.  It must also be
+# exported whenever recursing into a host directory in case that
+# directory's Makefile re-runs configure.
+HOST_EXPORTS = \
+       CC="$(CC)"; export CC; \
+       CFLAGS="$(CFLAGS)"; export CFLAGS; \
+       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+       CXX="$(CXX)"; export CXX; \
+       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+       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; \
+       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
+       NM="$(NM)"; export NM; \
+       RANLIB="$(RANLIB)"; export RANLIB; \
+       WINDRES="$(WINDRES)"; export WINDRES; \
+       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+       OBJDUMP="$(OBJDUMP)"; export OBJDUMP;
+
+# Similar, for the gcc directory.
+GCC_HOST_EXPORTS = \
+       $(HOST_EXPORTS) \
+       TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC;
+
+# Similar, for later GCC stages.
+STAGE_HOST_EXPORTS = \
+       $(GCC_HOST_EXPORTS) \
+       CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -126,6 +180,35 @@ TARGET_SUBDIR = @target_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 the list of variables to export in the environment when
+# configuring subdirectories for the host system.  It must also be
+# exported whenever recursing into a host directory in case that
+# directory's Makefile re-runs configure.
+BASE_TARGET_EXPORTS = \
+       AR="$(AR_FOR_TARGET)"; export AR; \
+       AS="$(AS_FOR_TARGET)"; export AS; \
+       CC="$(CC_FOR_TARGET)"; export CC; \
+       CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+       CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+       CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+       GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+       GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
+       DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+       LD="$(LD_FOR_TARGET)"; export LD; \
+       LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+       NM="$(NM_FOR_TARGET)"; export NM; \
+       RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
+
+RAW_CXX_TARGET_EXPORTS = \
+       $(BASE_TARGET_EXPORTS) \
+       CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+       CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
+
+NORMAL_TARGET_EXPORTS = \
+       $(BASE_TARGET_EXPORTS) \
+       CXX="$(CXX_FOR_TARGET)"; export CXX;
 
 # Where to find GMP
 HOST_GMPLIBS = @gmplibs@
@@ -387,8 +470,7 @@ PICFLAG_FOR_TARGET =
 
 # The first rule in the file had better be this one.  Don't put any above it.
 # This lives here to allow makefile fragments to contain dependencies.
-all: all.normal
-.PHONY: all
+@default_target@:
 
 #### host and target specific makefile fragments come in here.
 @target_makefile_frag@
@@ -493,9 +575,9 @@ configure-target: [+
     maybe-configure-target-[+module+][+
   ENDFOR target_modules +]
 
-# The target built for a native build.
-.PHONY: all.normal
-all.normal: @all_build_modules@ all-host all-target
+# The target built for a native non-bootstrap build.
+.PHONY: all
+all: @all_build_modules@ all-host all-target
 
 .PHONY: all-host
 all-host: maybe-all-gcc [+
@@ -649,6 +731,7 @@ install.all: install-no-fixedincludes
        @if [ -f ./gcc/Makefile ] ; then \
                r=`${PWD_COMMAND}` ; export r ; \
                $(SET_LIB_PATH) \
+               $(GCC_HOST_EXPORTS) \
                (cd ./gcc && \
                $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
        else \
@@ -704,21 +787,7 @@ configure-build-[+module+]:
        $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       AR="$(AR_FOR_BUILD)"; export AR; \
-       AS="$(AS_FOR_BUILD)"; export AS; \
-       CC="$(CC_FOR_BUILD)"; export CC; \
-       CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CXX="$(CXX_FOR_BUILD)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
-       GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
-       GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
-       DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
-       LD="$(LD_FOR_BUILD)"; export LD; \
-       LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
-       NM="$(NM_FOR_BUILD)"; export NM; \
-       RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
-       WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+       $(BUILD_EXPORTS) \
        echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
        cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
        case $(srcdir) in \
@@ -768,6 +837,7 @@ maybe-all-build-[+module+]: all-build-[+module+]
 all-build-[+module+]: configure-build-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+       $(BUILD_EXPORTS) \
        (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
 @endif build-[+module+]
 [+ ENDFOR build_modules +]
@@ -785,22 +855,7 @@ configure-[+module+]:
        [ -d [+module+] ] || mkdir [+module+]; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       CC="$(CC)"; export CC; \
-       CFLAGS="$(CFLAGS)"; export CFLAGS; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CXX="$(CXX)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-       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; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
-       NM="$(NM)"; export NM; \
-       RANLIB="$(RANLIB)"; export RANLIB; \
-       WINDRES="$(WINDRES)"; export WINDRES; \
-       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-       OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       $(HOST_EXPORTS) \
        echo Configuring in [+module+]; \
        cd [+module+] || exit 1; \
        case $(srcdir) in \
@@ -827,6 +882,7 @@ all-[+module+]: configure-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(HOST_EXPORTS) \
        (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
          IF with_x 
            +] $(X11_FLAGS_TO_PASS)[+ 
@@ -846,6 +902,7 @@ check-[+module+]:
          r=`${PWD_COMMAND}`; export r; \
          s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(SET_LIB_PATH) \
+         $(HOST_EXPORTS) \
          (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
            IF with_x 
              +] $(X11_FLAGS_TO_PASS)[+ 
@@ -856,6 +913,7 @@ check-[+module+]:
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(HOST_EXPORTS) \
        (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
          IF with_x 
            +] $(X11_FLAGS_TO_PASS)[+ 
@@ -874,6 +932,7 @@ install-[+module+]: installdirs
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(HOST_EXPORTS) \
        (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
          IF with_x 
            +] $(X11_FLAGS_TO_PASS)[+ 
@@ -899,6 +958,7 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(HOST_EXPORTS) \
        for flag in $(EXTRA_HOST_FLAGS); do \
          eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
        done; \
@@ -935,28 +995,12 @@ configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
        $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; 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; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ 
+       $(SET_LIB_PATH) \[+
 IF raw_cxx +]
-       CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-       CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ 
+       $(RAW_CXX_TARGET_EXPORTS) \[+
 ELSE normal_cxx +]
-       CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ 
+       $(NORMAL_TARGET_EXPORTS) \[+
 ENDIF raw_cxx +]
-       CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-       GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-       GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
-       DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-       LD="$(LD_FOR_TARGET)"; export LD; \
-       LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-       NM="$(NM_FOR_TARGET)"; export NM; \
-       RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
        echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
        cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
        case $(srcdir) in \
@@ -1006,7 +1050,12 @@ maybe-all-target-[+module+]: all-target-[+module+]
 all-target-[+module+]: configure-target-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(SET_LIB_PATH) \
+       $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+       $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+       $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
        (cd $(TARGET_SUBDIR)/[+module+] && \
          $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
            IF raw_cxx 
@@ -1026,7 +1075,12 @@ check-target-[+module+]:
 check-target-[+module+]:
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(SET_LIB_PATH) \
+       $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+       $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+       $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
        (cd $(TARGET_SUBDIR)/[+module+] && \
          $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
            IF raw_cxx 
@@ -1047,7 +1101,12 @@ install-target-[+module+]:
 install-target-[+module+]: installdirs
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(SET_LIB_PATH) \
+       $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+       $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+       $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
        (cd $(TARGET_SUBDIR)/[+module+] && \
          $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
 [+ ENDIF no_install +]
@@ -1070,7 +1129,12 @@ maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
        @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(SET_LIB_PATH) \
+       $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+       $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+       $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
        echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
        for flag in $(EXTRA_TARGET_FLAGS); do \
          eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -1106,30 +1170,13 @@ maybe-configure-gcc:
 @if gcc
 maybe-configure-gcc: configure-gcc
 configure-gcc:
+@endif gcc
+@if gcc-no-bootstrap
        @test ! -f gcc/Makefile || exit 0; \
-       [ -f stage_last ] && exit 0; \
        [ -d gcc ] || mkdir gcc; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       CC="$(CC)"; export CC; \
-       CFLAGS="$(CFLAGS)"; export CFLAGS; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CXX="$(CXX)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-       TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-       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; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
-       NM="$(NM)"; export NM; \
-       RANLIB="$(RANLIB)"; export RANLIB; \
-       WINDRES="$(WINDRES)"; export WINDRES; \
-       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-       OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
-       GMPINC="$(HOST_GMPINC)"; export GMPINC; \
+       $(GCC_HOST_EXPORTS) \
        echo Configuring in gcc; \
        cd gcc || exit 1; \
        case $(srcdir) in \
@@ -1146,7 +1193,7 @@ configure-gcc:
        $(SHELL) $${libsrcdir}/configure \
          $(HOST_CONFIGARGS) $${srcdiroption} \
          || exit 1
-@endif gcc
+@endif gcc-no-bootstrap
 
 # 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
@@ -1156,18 +1203,17 @@ maybe-all-gcc:
 @if gcc
 maybe-all-gcc: all-gcc
 all-gcc: configure-gcc
+@endif gcc
+@if gcc-no-bootstrap
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       if [ -f stage_last ] ; then \
-         true ; \
-       elif [ -f gcc/stage_last ] ; then \
-         $(SET_LIB_PATH) \
+       $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
+       if [ -f gcc/stage_last ] ; then \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
        else \
-         $(SET_LIB_PATH) \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
        fi
-@endif gcc
 
 # Building GCC uses some tools for rebuilding "source" files
 # like texinfo, bison/byacc, etc.  So we must depend on those.
@@ -1185,6 +1231,7 @@ $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
        echo "Bootstrapping the compiler"; \
        cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
        @r=`${PWD_COMMAND}`; export r; \
@@ -1204,6 +1251,7 @@ $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc
            compare=compare ;; \
        esac; \
        $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
        echo "$$msg"; \
        cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
        @r=`${PWD_COMMAND}`; export r; \
@@ -1216,6 +1264,7 @@ profiledbootstrap: all-bootstrap configure-gcc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
        echo "Bootstrapping the compiler"; \
        cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
        @r=`${PWD_COMMAND}`; export r; \
@@ -1226,6 +1275,7 @@ profiledbootstrap: all-bootstrap configure-gcc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
        echo "Building feedback based compiler"; \
        cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
 
@@ -1234,6 +1284,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
+       $(GCC_HOST_EXPORTS) \
        echo "Building the C and C++ compiler"; \
        cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
        @r=`${PWD_COMMAND}`; export r; \
@@ -1241,7 +1292,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
        $(SET_LIB_PATH) \
        echo "Building runtime libraries"; \
        $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
-         LANGUAGES="c c++" all
+               LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
 
 .PHONY: check-gcc maybe-check-gcc
 maybe-check-gcc:
@@ -1252,6 +1304,7 @@ check-gcc:
          r=`${PWD_COMMAND}`; export r; \
          s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(SET_LIB_PATH) \
+         $(GCC_HOST_EXPORTS) \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
        else \
          true; \
@@ -1263,6 +1316,7 @@ check-gcc-c++:
          r=`${PWD_COMMAND}`; export r; \
          s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(SET_LIB_PATH) \
+         $(GCC_HOST_EXPORTS) \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
        else \
          true; \
@@ -1281,6 +1335,7 @@ install-gcc:
          r=`${PWD_COMMAND}`; export r; \
          s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(SET_LIB_PATH) \
+         $(GCC_HOST_EXPORTS) \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
        else \
          true; \
@@ -1302,6 +1357,7 @@ gcc-no-fixedincludes:
          r=`${PWD_COMMAND}`; export r; \
          s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
          $(SET_LIB_PATH) \
+         $(GCC_HOST_EXPORTS) \
          (cd ./gcc && \
           $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
          rm -rf gcc/include; \
@@ -1325,6 +1381,7 @@ maybe-[+make_target+]-gcc: [+make_target+]-gcc
        for flag in $(EXTRA_GCC_FLAGS); do \
          eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
        done; \
+       $(GCC_HOST_EXPORTS) \
        echo "Doing [+make_target+] in gcc" ; \
        (cd gcc && \
          $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -1337,6 +1394,7 @@ maybe-[+make_target+]-gcc: [+make_target+]-gcc
 
 [+ ENDFOR recursive_targets +]
 
+@if gcc-bootstrap
 # ---------------------
 # GCC bootstrap support
 # ---------------------
@@ -1382,7 +1440,7 @@ objext = .o
 # Real targets act phony if they depend on phony targets; this hack
 # prevents gratuitous rebuilding of stage 1.
 prebootstrap:
-       $(MAKE) all-bootstrap
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-bootstrap
        $(STAMP) prebootstrap
 
 # Flags to pass to stage2 and later makes.
@@ -1401,16 +1459,16 @@ POSTSTAGE1_FLAGS_TO_PASS = \
 # * We build only C (and possibly Ada).
 
 [+ FOR bootstrap-stage +]
-.PHONY: new-stage[+id+]-start new-stage[+id+]-end
+.PHONY: stage[+id+]-start stage[+id+]-end
 
-new-stage[+id+]-start:
-       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+stage[+id+]-start:
+       [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
        echo stage[+id+] > stage_last ; \
        [ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
        set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
        set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
 
-new-stage[+id+]-end:
+stage[+id+]-end:
        rm -f stage_last ; \
        set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
        set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
@@ -1418,22 +1476,23 @@ new-stage[+id+]-end:
 # Bubble a bugfix through all the stages up to stage [+id+].  They
 # are remade, but not reconfigured.  The next stage (if any) will not
 # be reconfigured as well.
-.PHONY: new-stage[+id+]-bubble
-new-stage[+id+]-bubble: [+ IF prev +]new-stage[+prev+]-bubble[+ ENDIF +]
+.PHONY: stage[+id+]-bubble
+stage[+id+]-bubble: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
        @if [ -f all-stage[+id+]-gcc ] ; then \
          echo Remaking stage [+id+] ; \
          rm -f all-stage[+id+]-gcc ; \
-         $(MAKE) all-stage[+id+]-gcc [+ IF next +] && \
+         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+           all-stage[+id+]-gcc [+ IF next +] && \
          if [ -f configure-stage[+next+]-gcc ] ; then \
            $(STAMP) configure-stage[+next+]-gcc ; \
          fi [+ ENDIF next +]; \
        else \
-         $(MAKE) all-stage[+id+]-gcc ; \
+         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-stage[+id+]-gcc ; \
        fi
 
 configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
          ELSE +] prebootstrap [+ ENDIF prev +]
-       $(MAKE) new-stage[+id+]-start
+       $(MAKE) stage[+id+]-start
        @if [ -f stage[+id+]-gcc/Makefile ] ; then \
          $(STAMP) configure-stage[+id+]-gcc ; \
          exit 0; \
@@ -1441,28 +1500,9 @@ configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
          true ; \
        fi ; \
        r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-       CFLAGS="$(CFLAGS)"; export CFLAGS; \
-       CXX="$(CXX)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-       AR="$(AR)"; export AR; \
-       AS="$(AS)"; export AS; \
-       DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-       LD="$(LD)"; export LD; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
-       NM="$(NM)"; export NM; \
-       RANLIB="$(RANLIB)"; export RANLIB; \
-       WINDRES="$(WINDRES)"; export WINDRES; \
-       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-       OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
-       GMPINC="$(HOST_GMPINC)"; export GMPINC [+ IF prev +] ; \
-       CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD [+ ELSE +] ; \
-       CC="$(CC)"; export CC; \
-       CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD [+ ENDIF prev +] ; \
+       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+       $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+       $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \
        echo Configuring stage [+id+] in gcc ; \
        cd gcc || exit 1; \
        case $(srcdir) in \
@@ -1482,19 +1522,20 @@ configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
          $(STAMP) ../configure-stage[+id+]-gcc
 
 all-stage[+id+]-gcc: configure-stage[+id+]-gcc
-       $(MAKE) new-stage[+id+]-start
+       $(MAKE) stage[+id+]-start
        @r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+       $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+       $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \
        cd gcc && \
        $(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \
-               CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
+               CC="$${CC}" CC_FOR_BUILD="${CC_FOR_BUILD}" \
                STAGE_PREFIX=$$r/stage[+prev+]-gcc/ [+ ENDIF prev +] \
                [+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc
 
 [+ IF compare-target +]
 [+compare-target+]: all-stage[+id+]-gcc
-       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        rm -f .bad_compare ; \
@@ -1519,23 +1560,23 @@ all-stage[+id+]-gcc: configure-stage[+id+]-gcc
 [+ IF bootstrap-target +]
 .PHONY: [+bootstrap-target+]
 [+bootstrap-target+]:
-       $(MAKE) new-stage[+id+]-bubble [+
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) stage[+id+]-bubble [+
          IF compare-target +] [+compare-target+] [+
          ENDIF compare-target +] \
-         new-stage[+id+]-start all new-stage[+id+]-end 
+         stage[+id+]-start all stage[+id+]-end 
 [+ ENDIF bootstrap-target +]
 
-.PHONY: new-restage[+id+] distclean-stage[+id+]
+.PHONY: restage[+id+] distclean-stage[+id+]
 
 distclean-stage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
-       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
        rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
          IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
 
-new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
+restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
        rm -rf all-stage[+id+]-gcc [+
          IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
-       $(MAKE) [+
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) [+
          IF compare-target +][+compare-target+] [+
          ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
 
@@ -1545,6 +1586,7 @@ new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
 [+ ENDIF cleanstrap-target +]
 
 [+ ENDFOR bootstrap-stage +]
+@endif gcc-bootstrap
 
 # --------------------------------------
 # Dependencies between different modules
This page took 0.030474 seconds and 4 git commands to generate.