2009-09-02 Paolo Bonzini <bonzini@gnu.org>
[deliverable/binutils-gdb.git] / Makefile.tpl
index bc7c415f090d796cf7f5531d033b5db913893443..f12252b2c43fe4428297606040b4c30c527e408f 100644 (file)
@@ -11,7 +11,7 @@ in
 #
 # 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 # 
 # This program is distributed in the hope that it will be useful,
@@ -20,8 +20,8 @@ in
 # GNU General Public License for more details.
 # 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
 #
 
 # First, test for a proper version of make, but only where one is required.
@@ -120,6 +120,19 @@ BUILD_SUBDIR = @build_subdir@
 # directories built for the build system.
 BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
 
+# Linker flags to use on the host, for stage1 or when not
+# bootstrapping.
+STAGE1_LDFLAGS = @stage1_ldflags@
+
+# Libraries to use on the host, for stage1 or when not bootstrapping.
+STAGE1_LIBS = @stage1_libs@
+
+# Linker flags to use for stage2 and later.
+POSTSTAGE1_LDFLAGS = @poststage1_ldflags@
+
+# Libraries to use for stage2 and later.
+POSTSTAGE1_LIBS = @poststage1_libs@
+
 # This is the list of variables to export in the environment when
 # configuring any subdirectory.  It must also be exported whenever
 # recursing into a build directory in case that directory's Makefile
@@ -130,6 +143,8 @@ BASE_EXPORTS = \
        BISON="$(BISON)"; export BISON; \
        YACC="$(YACC)"; export YACC; \
        M4="$(M4)"; export M4; \
+       SED="$(SED)"; export SED; \
+       AWK="$(AWK)"; export AWK; \
        MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
 
 # This is the list of variables to export in the environment when
@@ -185,7 +200,7 @@ HOST_EXPORTS = \
        CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
        DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
        LD="$(LD)"; export LD; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
+       LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
        NM="$(NM)"; export NM; \
        RANLIB="$(RANLIB)"; export RANLIB; \
        WINDRES="$(WINDRES)"; export WINDRES; \
@@ -200,6 +215,7 @@ HOST_EXPORTS = \
        OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
        RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
+       HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
        GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
        GMPINC="$(HOST_GMPINC)"; export GMPINC; \
        PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \
@@ -218,8 +234,16 @@ POSTSTAGE1_HOST_EXPORTS = \
          -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
          $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
        CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
-       GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND \
-       LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
+       CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
+         -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
+         -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
+         -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
+         -I$$r/$(srcdir)/libstdc++-v3/libsupc++ \
+         -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
+       CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; \
+       GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
+       LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
+       HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
 
 # Target libraries are put under this directory:
 TARGET_SUBDIR = @target_subdir@
@@ -315,6 +339,8 @@ BOOT_CFLAGS= -g -O2
 BOOT_LDFLAGS=
 BOOT_ADAFLAGS=-gnatpg -gnata
 
+AWK = @AWK@
+SED = @SED@
 BISON = @BISON@
 YACC = @YACC@
 FLEX = @FLEX@
@@ -540,8 +566,11 @@ X11_FLAGS_TO_PASS = \
 # Flags to pass to stage2 and later makes.
 
 POSTSTAGE1_FLAGS_TO_PASS = \
-       CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" GNATBIND="$${GNATBIND}" \
-       LDFLAGS="$(BOOT_LDFLAGS)" \
+       CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
+       CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
+       GNATBIND="$${GNATBIND}" \
+       LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)" \
+       HOST_LIBS="$(POSTSTAGE1_LIBS)" \
        "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
 
 # Flags to pass down to makes which are built with the target environment.
@@ -621,15 +650,16 @@ all:
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 @if gcc-bootstrap
        if [ -f stage_last ]; then \
-         TFLAGS="$(STAGE$(shell sed s,^stage,, stage_last)_TFLAGS)"; \
+         TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \
          $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
        else \
 @endif gcc-bootstrap
          $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
 @if gcc-bootstrap
            ; \
-       fi
+       fi \
 @endif gcc-bootstrap
+       && :
 
 .PHONY: all-build
 [+ FOR build_modules +]
@@ -1426,15 +1456,16 @@ do-clean: clean-stage[+id+]
        : $(MAKE); $(stage); \
        rm -f .bad_compare ; \
        echo Comparing stages [+prev+] and [+id+] ; \
-       cd stage[+id+]-gcc; \
-       files=`find . -name "*$(objext)" -print` ; \
-       cd .. ; \
+        sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
+       files=`find stage[+id+]-* -name "*$(objext)" -print | \
+                sed -n s,^stage$$sed-,,p` ; \
        for file in $${files} ; do \
-         f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
+         f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
+         if test ! -f $$f1; then continue; fi; \
          $(do-[+compare-target+]) > /dev/null 2>&1; \
          if test $$? -eq 1; then \
            case $$file in \
-             ./cc*-checksum$(objext) | ./libgcc/* ) \
+             @compare_exclusions@) \
                echo warning: $$file differs ;; \
              *) \
                echo $$file differs >> .bad_compare ;; \
This page took 0.026438 seconds and 4 git commands to generate.