OSDN Git Service

PR middle-end/40084
[pf3gnuchains/gcc-fork.git] / Makefile.tpl
index 42f3331..dd2e1c1 100644 (file)
@@ -6,11 +6,12 @@ in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+#   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
-# 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,
@@ -19,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.
@@ -140,7 +141,6 @@ BUILD_EXPORTS = \
        CC="$(CC_FOR_BUILD)"; export CC; \
        CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
        CXX="$(CXX_FOR_BUILD)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
        GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
@@ -154,10 +154,9 @@ BUILD_EXPORTS = \
        WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
 
 # These variables must be set on the make command line for directories
-# built for the build system to override those in BASE_FLAGS_TO_PASS.
+# built for the build system to override those in BASE_FLAGS_TO_PASSS.
 EXTRA_BUILD_FLAGS = \
        CFLAGS="$(CFLAGS_FOR_BUILD)" \
-       CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
        LDFLAGS="$(LDFLAGS_FOR_BUILD)"
 
 # This is the list of directories to built for the host system.
@@ -177,7 +176,6 @@ HOST_EXPORTS = \
        ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
        CFLAGS="$(CFLAGS)"; export CFLAGS; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       CPPFLAGS="$(CPPFLAGS)"; export CPPFLAGS; \
        CXX="$(CXX)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
        AR="$(AR)"; export AR; \
@@ -220,6 +218,7 @@ POSTSTAGE1_HOST_EXPORTS = \
          $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
          -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
          -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
+       GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND \
        LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
 
 # Target libraries are put under this directory:
@@ -293,7 +292,6 @@ AR_FOR_BUILD = @AR_FOR_BUILD@
 AS_FOR_BUILD = @AS_FOR_BUILD@
 CC_FOR_BUILD = @CC_FOR_BUILD@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
 CXX_FOR_BUILD = @CXX_FOR_BUILD@
 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
@@ -355,7 +353,6 @@ GNATBIND = @GNATBIND@
 GNATMAKE = @GNATMAKE@
 
 CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
@@ -419,14 +416,13 @@ COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
 COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
 
 CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
-CPPFLAGS_FOR_TARGET = @CPPFLAGS_FOR_TARGET@
 CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
 DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
 
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
+LDFLAGS_FOR_TARGET = 
 
 # ------------------------------------
 # Miscellaneous targets and flag lists
@@ -518,8 +514,7 @@ 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="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
+       CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" GNATBIND="$${GNATBIND}" \
        LDFLAGS="$(BOOT_LDFLAGS)" \
        "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
 
@@ -533,7 +528,6 @@ EXTRA_TARGET_FLAGS = \
        'AS=$(COMPILER_AS_FOR_TARGET)' \
        'CC=$$(CC_FOR_TARGET)' \
        'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
-       'CPPFLAGS=$$(CPPFLAGS_FOR_TARGET)' \
        'CXX=$$(CXX_FOR_TARGET)' \
        'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
        'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
@@ -1223,19 +1217,15 @@ cross: all-build all-gas all-ld
 @endif gcc-no-bootstrap
 
 @if gcc
-.PHONY: check-gcc-c++
-check-gcc-c++:
-       @if [ -f ./gcc/Makefile ] ; then \
-         r=`${PWD_COMMAND}`; export r; \
-         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-         $(HOST_EXPORTS) \
-         (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
-       else \
-         true; \
-       fi
-
-.PHONY: check-c++
-check-c++: check-target-libstdc++-v3 check-gcc-c++
+[+ FOR languages +]
+.PHONY: check-gcc-[+language+] check-[+language+]
+check-gcc-[+language+]:
+       r=`${PWD_COMMAND}`; export r; \
+       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+       $(HOST_EXPORTS) \
+       (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
+check-[+language+]: check-gcc-[+language+][+ IF lib-check-target +] [+ lib-check-target +][+ ENDIF lib-check-target +]
+[+ ENDFOR languages +]
 
 # Install the gcc headers files, but not the fixed include files,
 # which Cygnus is not allowed to distribute.  This rule is very
@@ -1475,6 +1465,8 @@ do-distclean: distclean-stage1
 # Provide a GCC build when we're building target libraries.  This does
 # not work as a dependency, just as the minimum necessary to avoid errors.
 stage_last:
+       @r=`${PWD_COMMAND}`; export r; \
+       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
 
 # Same as unstage, but not phony and defaulting to stage1-start.  We place