Fix likely typo, reduce number of instruction name collisions.
[oota-llvm.git] / utils / buildit / GNUmakefile
index 6e5131254cb0ee999c6797d91f83d19122ebe177..470ee76b60fe42f84d4a0211f3ada9530ac6f4da 100644 (file)
@@ -6,7 +6,7 @@
 #
 # You can specify TARGETS=ppc (or i386) on the buildit command line to limit the
 # build to just one target. The default is for ppc and i386. The compiler
-# targetted at this host gets built anyway, but not installed unless it's listed
+# targeted at this host gets built anyway, but not installed unless it's listed
 # in TARGETS.
 
 # Include the set of standard Apple makefile definitions.
@@ -32,13 +32,11 @@ DSTROOT = $(OBJROOT)/../dst
 
 #######################################################################
 
-PREFIX = /usr/local
+PREFIX = /Developer/usr/local
 
 # Unless assertions are forced on in the GMAKE command line, disable them.
-ifdef ENABLE_ASSERTIONS
-LLVM_ASSERTIONS := yes
-else
-LLVM_ASSERTIONS := no
+ifndef ENABLE_ASSERTIONS
+ENABLE_ASSERTIONS := no
 endif
 
 # Default is optimized build.
@@ -48,6 +46,13 @@ else
 LLVM_OPTIMIZED := yes
 endif
 
+# Default to not install libLTO.dylib.
+INSTALL_LIBLTO := no
+
+# Default to do a native build, not a cross-build for an ARM host or simulator.
+ARM_HOSTED_BUILD := no
+IOS_SIM_BUILD := no
+
 ifndef RC_ProjectSourceVersion
 RC_ProjectSourceVersion = 9999
 endif
@@ -59,11 +64,25 @@ endif
 # NOTE : Always put version numbers at the end because they are optional.
 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
        cd $(OBJROOT) && \
-         $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
+         $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
            $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
-           $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) \
+           $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
+           $(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
            $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) 
 
+EmbeddedHosted:
+       $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install
+
+# When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set
+# by default, but it needs to be set when building tools that run on the host
+# (e.g., tblgen), so set it here.
+EmbeddedSim:
+       export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \
+       $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install
+
+Embedded:
+       ARM_PLATFORM=`xcodebuild -version -sdk iphoneos PlatformPath` && \
+       $(MAKE) DSTROOT=$(DSTROOT)$$ARM_PLATFORM install
 
 # installhdrs does nothing, because the headers aren't useful until
 # the compiler is installed.
@@ -85,6 +104,7 @@ installsrc:
                                -type f -a -name .DS_Store -o \
                                -name \*~ -o -name .\#\* \) \
          -exec rm -rf {} \;
+       rm -rf "$(SRCROOT)/test"
 
 #######################################################################
 
@@ -112,4 +132,4 @@ clean:
 $(OBJROOT) $(SYMROOT) $(DSTROOT):
        mkdir -p $@
 
-.PHONY: install installsrc clean
+.PHONY: install installsrc clean EmbeddedHosted EmbeddedSim Embedded