[llvm-branch-commits] [cfe-branch] r102521 - /cfe/branches/Apple/whitney-IB/Makefile

Daniel Dunbar daniel at zuster.org
Wed Apr 28 13:22:32 PDT 2010


Author: ddunbar
Date: Wed Apr 28 15:22:32 2010
New Revision: 102521

URL: http://llvm.org/viewvc/llvm-project?rev=102521&view=rev
Log:
Add build variable to toggle whether we do a bootstrap build or not, and whether
we support C++ or not.

Also, remove some unused utility targets.

Modified:
    cfe/branches/Apple/whitney-IB/Makefile

Modified: cfe/branches/Apple/whitney-IB/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/Makefile?rev=102521&r1=102520&r2=102521&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/Makefile (original)
+++ cfe/branches/Apple/whitney-IB/Makefile Wed Apr 28 15:22:32 2010
@@ -15,6 +15,10 @@
 Clang_Optimize_Option  := -O2
 # Additional arbitrary compiler options.
 Clang_Extra_Options    := -g -DDISABLE_SMART_POINTERS
+# Enable use of clang++?
+Clang_Enable_CXX       := 1
+# Enable bootstrap build.
+Clang_Enable_Bootstrap := 1
 # Build all LLVM tools; not just clang?
 Clang_Build_All        := 0
 
@@ -42,7 +46,15 @@
 Clang_Make_Variables := KEEP_SYMBOLS=1 CLANG_VENDOR=Apple
 ifeq ($(Clang_Driver_Mode), Production)
 Clang_Make_Variables += CLANG_IS_PRODUCTION=1
+
+ifeq ($(Clang_Enable_CXX), 1)
 Clang_Make_Variables += CLANGXX_IS_PRODUCTION=1
+else ifeq ($(Clang_Enable_CXX), 0)
+# ... this is the default ...
+else
+$(error "invalid setting for clang enable C++: '$(Clang_Enable_CXX)'")
+endif
+
 else ifeq ($(Clang_Driver_Mode), Development)
 # ... this is the default ...
 else
@@ -91,6 +103,16 @@
 $(error "unknown value for post install of open source license: '$(Post_Install_OpenSourceLicense)'")
 endif
 
+# Select final configure target.
+ifeq ($(Clang_Enable_Bootstrap), 1)
+Final_Configure_Target := configure_stage2
+else ifeq ($(Clang_Enable_Bootstrap), 0)
+Final_Configure_Target := configure_singlestage
+else
+$(error "invalid setting for clang enable bootstrap: '$(Clang_Enable_Bootstrap)'")
+endif
+
+# Set install and build targets.
 Install_Target = $(Clang_Make_Variables) install-clang
 Build_Target = $(Clang_Make_Variables) $(Clang_Build_Target)
 
@@ -105,27 +127,12 @@
 SVN_CLANG = $(shell svn info | sed -n 's/^URL: //p')
 SVN_TAGS = $(SVN_BASE)/cfe/tags/Apple
 
-update-clang-branch:
-	if [ -n "$(LLVM_VERSION)" ]; then \
-	  svn rm -m 'Update.' $(SVN_CLANG)/clang; \
-	  svn cp -m 'Update.' $(SVN_BASE)/llvm/tags/Apple/llvmCore-$(LLVM_VERSION) $(SVN_CLANG)/clang; \
-	  svn cp -m 'Update.' $(SVN_BASE)/cfe/branches/Apple/Dib $(SVN_CLANG)/clang/tools/clang; \
-	  svn cp -m 'Update.' $(SVN_BASE)/compiler-rt/branches/Apple/Dib $(SVN_CLANG)/clang/projects/compiler-rt; \
-	else \
-	  echo "Usage: make LLVM_VERSION=2108 update-clang"; \
-	fi
-
 update-clang:
 	svn rm -m 'Update.' $(SVN_CLANG)/clang
 	svn cp -m 'Update.' $(SVN_BASE)/llvm/trunk $(SVN_CLANG)/clang
 	svn cp -m 'Update.' $(SVN_BASE)/cfe/trunk $(SVN_CLANG)/clang/tools/clang
 	svn cp -m 'Update.' $(SVN_BASE)/compiler-rt/trunk $(SVN_CLANG)/clang/projects/compiler-rt
 
-update-to-tot:
-	rm -rf clang
-	svn co $(SVN_BASE)/llvm/trunk clang
-	svn co $(SVN_BASE)/cfe/trunk clang/tools/clang
-
 tag-clang:
 	if [ -n "$(VERSION)" ]; then \
 	  svn cp -m 'Tag.' $(SVN_CLANG) $(SVN_TAGS)/clang-$(VERSION); \
@@ -173,7 +180,10 @@
 ##
 # Build Logic
 
-.PHONY: install installsrc installhdrs build configure lazy_install_source install_source clean
+.PHONY: install installsrc installhdrs \
+	build build_final build_stage1 \
+	configure_final configure_singlestage configure_stage2 configure_stage1 \
+	lazy_install_source install_source clean
 
 SYSCTL := $(shell if [ `sysctl -n hw.activecpu` -ge 8 -a `sysctl -n hw.memsize` -le 2147483648 ]; then echo 4; else sysctl -n hw.activecpu; fi)
 
@@ -212,7 +222,16 @@
 		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/$$arch $(Build_Target) || exit 1; \
 	done
 
-configure_final:: build_stage1
+build_stage1:: configure_stage1
+	$(_v) for arch in $(RC_ARCHS) ; do \
+		echo "Building (Stage 1) $(Project) for $$arch..." && \
+		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Build_Target) || exit 1; \
+		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Install_Target) || exit 1; \
+	done
+
+configure_final:: $(Final_Configure_Target)
+
+configure_stage2:: build_stage1
 	$(_v) $(MKDIR) $(OBJROOT)
 	$(_v) for arch in $(RC_ARCHS) ; do \
 		echo "Configuring (Final) $(Project) for $$arch..." && \
@@ -223,11 +242,15 @@
 		  CXX="$(OBJROOT)/stage1-install-$$arch/bin/clang++ -arch $$arch" || exit 1 ; \
 	done
 
-build_stage1:: configure_stage1
+configure_singlestage::
+	$(_v) $(MKDIR) $(OBJROOT)
 	$(_v) for arch in $(RC_ARCHS) ; do \
-		echo "Building (Stage 1) $(Project) for $$arch..." && \
-		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Build_Target) || exit 1; \
-		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Install_Target) || exit 1; \
+		echo "Configuring (Final) $(Project) for $$arch..." && \
+		$(MKDIR) $(OBJROOT)/$$arch && \
+		cd $(OBJROOT)/$$arch && \
+		$(Configure) --prefix="$(Install_Prefix)" $(Configure_Flags) \
+		  CC="$(CC) -arch $$arch" \
+		  CXX="$(CXX) -arch $$arch" || exit 1 ; \
 	done
 
 configure_stage1:: 





More information about the llvm-branch-commits mailing list