[llvm-branch-commits] [cfe-branch] r116523 - /cfe/branches/Apple/whitney-IB/ClangBNI.mk

Daniel Dunbar daniel at zuster.org
Thu Oct 14 14:41:48 PDT 2010


Author: ddunbar
Date: Thu Oct 14 16:41:48 2010
New Revision: 116523

URL: http://llvm.org/viewvc/llvm-project?rev=116523&view=rev
Log:
Don't follow standard recursive make behavior of propagating command line
overrides, this isn't really a recursive make, which is necessary for overriding
CC or CXX to work properly (with multi stage builds).

Modified:
    cfe/branches/Apple/whitney-IB/ClangBNI.mk

Modified: cfe/branches/Apple/whitney-IB/ClangBNI.mk
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/ClangBNI.mk?rev=116523&r1=116522&r2=116523&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/ClangBNI.mk (original)
+++ cfe/branches/Apple/whitney-IB/ClangBNI.mk Thu Oct 14 16:41:48 2010
@@ -224,6 +224,10 @@
 Configure_Flags = $(Common_Configure_Flags) \
                   --with-extra-options="$(Extra_Options) $(Clang_Final_Extra_Options)"
 
+# Select stage1 compiler.
+Stage1_CC := $(CC)
+Stage1_CXX := $(CXX)
+
 # Set up any additional Clang install targets.
 Extra_Clang_Install_Targets :=
 
@@ -384,15 +388,20 @@
 ##
 # Additional Tool Paths
 
-CHOWN		= /usr/sbin/chown
-CXX             = /usr/bin/g++
-FIND		= /usr/bin/find
-INSTALL		= /usr/bin/install
-INSTALL_FILE	= $(INSTALL) -m 0444
-MKDIR		= /bin/mkdir -p -m 0755
-PAX		= /bin/pax
-RMDIR		= /bin/rm -fr
-XARGS		= /usr/bin/xargs
+CHOWN		:= /usr/sbin/chown
+CXX             := /usr/bin/g++
+FIND		:= /usr/bin/find
+INSTALL		:= /usr/bin/install
+INSTALL_FILE	:= $(INSTALL) -m 0444
+MKDIR		:= /bin/mkdir -p -m 0755
+PAX		:= /bin/pax
+RMDIR		:= /bin/rm -fr
+XARGS		:= /usr/bin/xargs
+
+# We aren't really a recursive make, rather we are a separate build which just
+# happens to use make for a sub-task. For that reason, we redefine MAKE to not
+# propagate overrides.
+MAKE            := env MAKEFLAGS= $(MAKE_COMMAND)
 
 ## 
 # Tool Variables
@@ -506,8 +515,8 @@
 		$(MKDIR) $(OBJROOT)/$$arch && \
 		cd $(OBJROOT)/$$arch && \
 		time $(Configure) --prefix="$(Install_Prefix)" $(Configure_Flags) \
-		  CC="$(CC) -arch $$arch" \
-		  CXX="$(CXX) -arch $$arch" || exit 1 ; \
+		  CC="$(Stage1_CC) -arch $$arch" \
+		  CXX="$(Stage1_CXX) -arch $$arch" || exit 1 ; \
 	done
 
 configure-clang_stage1: 
@@ -516,7 +525,8 @@
 	$(_v) $(MKDIR) $(OBJROOT)/stage1-$(Stage1_Compiler_Arch)
 	$(_v) cd $(OBJROOT)/stage1-$(Stage1_Compiler_Arch) && \
 	      time $(Configure) --prefix="$(OBJROOT)/stage1-install-$(Stage1_Compiler_Arch)" $(Stage1_Configure_Flags) \
-	        CC="$(CC) -arch $(Stage1_Compiler_Arch)" CXX="$(CXX) -arch $(Stage1_Compiler_Arch)" || exit 1
+	        CC="$(Stage1_CC) -arch $(Stage1_Compiler_Arch)" \
+		CXX="$(Stage1_CXX) -arch $(Stage1_Compiler_Arch)" || exit 1
 
 install-clang-rootlinks: install-clang_final
 	$(MKDIR) -p $(DSTROOT)/usr/bin





More information about the llvm-branch-commits mailing list