1 # LLVM LOCAL file build machinery
2 # LLVM Compiler Makefile for use by buildit.
4 # This makefile is intended only for use with B&I buildit. For "normal" builds
5 # use the conventional top-level makefile.
7 # You can specify TARGETS=ppc (or i386) on the buildit command line to limit the
8 # build to just one target. The default is for ppc and i386. The compiler
9 # targeted at this host gets built anyway, but not installed unless it's listed
12 # Include the set of standard Apple makefile definitions.
13 ifndef CoreOSMakefiles
14 CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
16 include $(CoreOSMakefiles)/Standard/Standard.make
18 # Enable Apple extensions to (gnu)make.
19 USE_APPLE_PB_SUPPORT = all
23 targets = echo $(RC_ARCHS)
24 TARGETS := $(shell $(targets))
28 SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
30 SYMROOT = $(OBJROOT)/../sym
31 DSTROOT = $(OBJROOT)/../dst
33 #######################################################################
37 # Unless assertions are forced on in the GMAKE command line, disable them.
38 ifndef ENABLE_ASSERTIONS
39 ENABLE_ASSERTIONS := no
42 # Default is optimized build.
43 ifeq ($(LLVM_DEBUG),1)
49 # Default to do a native build, not a cross-build for an ARM host or simulator.
50 ARM_HOSTED_BUILD := no
53 ifndef RC_ProjectSourceVersion
54 RC_ProjectSourceVersion = 9999
57 ifndef RC_ProjectSourceSubversion
58 RC_ProjectSourceSubversion = 0
61 # NOTE : Always put version numbers at the end because they are optional.
62 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
64 $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
65 $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
66 $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) \
67 $(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
68 $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
71 $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install
73 # When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set
74 # by default, but it needs to be set when building tools that run on the host
75 # (e.g., tblgen), so set it here.
77 export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \
78 $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install
81 ARM_PLATFORM=`xcodebuild -version -sdk iphoneos PlatformPath` && \
82 $(MAKE) DSTROOT=$(DSTROOT)$$ARM_PLATFORM/Developer install
84 # installhdrs does nothing, because the headers aren't useful until
85 # the compiler is installed.
88 # We build and install in one shell script.
93 @echo ++++++++++++++++++++++
94 @echo + Installing sources +
95 @echo ++++++++++++++++++++++
97 if [ $(SRCROOT) != . ]; then \
98 $(PAX) -rw . $(SRCROOT); \
100 find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
101 -type f -a -name .DS_Store -o \
102 -name \*~ -o -name .\#\* \) \
104 rm -rf "$(SRCROOT)/test"
106 #######################################################################
114 @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
115 echo '*** DELETING ' $(OBJROOT); \
118 @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
119 echo '*** DELETING ' $(SYMROOT); \
122 @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
123 echo '*** DELETING ' $(DSTROOT); \
127 #######################################################################
129 $(OBJROOT) $(SYMROOT) $(DSTROOT):
132 .PHONY: install installsrc clean EmbeddedHosted EmbeddedSim Embedded