1 # APPLE LOCAL file build machinery
2 # Apple GCC Compiler Makefile for use by buildit.
4 # This makefile is intended only for use with B&I buildit. For "normal"
5 # builds use the conventional FSF top-level makefile.
7 # You can specify TARGETS=ppc (or i386) on the buildit command line to
8 # limit the build to just one target. The default is for ppc and i386.
9 # The compiler targetted at this host gets built anyway, but not installed
10 # unless it's listed in TARGETS.
12 # The following default target is for the benefit of those who try to
13 # build llvm-gcc in the source directory. GNU make will prefer to use
14 # this GNUmakefile instead of the Makefile generated by configure. Since
15 # buildit always invokes this makefile with an explicit target, report an
16 # error for the default target and some other common gcc targets.
17 .PHONY
: all all-gcc all-host all-target bootstrap
18 all all-gcc all-host all-target bootstrap
:
20 @echo
"Error: llvm-gcc cannot be built in the source directory."
21 @echo
"Please follow the instructions in the README.LLVM file."
24 # Include the set of standard Apple makefile definitions.
25 ifndef CoreOSMakefiles
26 CoreOSMakefiles
= $(MAKEFILEPATH
)/CoreOS
28 include $(CoreOSMakefiles
)/Standard
/Standard.make
30 # Enable Apple extensions to (gnu)make.
31 USE_APPLE_PB_SUPPORT
= all
35 targets
= echo
$(RC_ARCHS
)
36 TARGETS
:= $(shell $(targets
))
40 SRC
= $(shell cd
$(SRCROOT
) && pwd | sed s
,/private
,,)
42 SYMROOT
= $(OBJROOT
)/..
/sym
43 DSTROOT
= $(OBJROOT
)/..
/dst
47 #######################################################################
50 # LLVM gets installed into /Developer/usr/local, not /usr.
52 PREFIX
= /Developer
/usr
/llvm-gcc-4.2
54 PREFIX
= ${DEVELOPER_DIR}/usr
/llvm-gcc-4.2
57 # Default to not reinstall libLTO.dylib.
60 # Unless assertions are forced on in the GMAKE command line, disable them.
61 ifndef ENABLE_ASSERTIONS
62 ENABLE_ASSERTIONS
:= no
67 LLVMCORE_PATH
= /Developer
/usr
/local
69 LLVMCORE_PATH
= ${DEVELOPER_DIR}/usr
/local
73 # Default is optimized build.
74 ifeq ($(LLVM_DEBUG
),1)
80 # Cross-builds for ARM hosts or iOS Simulator are not supported here.
81 ARM_HOSTED_BUILD
:= no
84 ifndef RC_ProjectSourceVersion
85 RC_ProjectSourceVersion
= 9999
88 ifndef RC_ProjectSourceSubversion
89 RC_ProjectSourceSubversion
= 00
93 $(MAKE
) OBJROOT
=$(OBJROOT
)/obj-llvmCore \
94 SYMROOT
=$(OBJROOT
)/sym-llvmCore \
95 DSTROOT
=$(OBJROOT
)/dst-llvmCore llvmCore
96 $(MAKE
) LLVMCORE_PATH
=$(OBJROOT
)/dst-llvmCore
/Developer
/usr
/local \
99 llvmCore
: $(OBJROOT
) $(SYMROOT
) $(DSTROOT
)
100 if
[ ! -d
$(SRC
)/llvmCore
]; then \
101 echo
"Error: llvmCore source directory is missing"; \
105 $(SRC
)/llvmCore
/utils
/buildit
/build_llvm
"$(RC_ARCHS)" "$(TARGETS)" \
106 $(SRC
)/llvmCore
/Developer
/usr
/local
$(DSTROOT
) $(SYMROOT
) \
107 $(ENABLE_ASSERTIONS
) $(LLVM_OPTIMIZED
) $(INSTALL_LIBLTO
) \
108 $(ARM_HOSTED_BUILD
) $(IOS_SIM_BUILD
) \
109 $(RC_ProjectSourceVersion
) $(RC_ProjectSourceSubversion
)
111 llvmgcc42
: $(OBJROOT
) $(SYMROOT
) $(DSTROOT
)
113 $(SRC
)/build_gcc
"$(RC_ARCHS)" "$(TARGETS)" \
114 $(SRC
) $(PREFIX
) $(DSTROOT
) $(SYMROOT
) $(INSTALL_LIBLTO
) \
115 $(ENABLE_ASSERTIONS
) $(LLVMCORE_PATH
) \
116 $(RC_ProjectSourceVersion
) $(RC_ProjectSourceSubversion
)
119 @if
[ -z
"$(ARM_SDK)" ]; then \
120 echo
"ARM_SDK must be set to build the Embedded target"; \
123 ARM_PLATFORM
=`xcodebuild -version -sdk $(ARM_SDK) PlatformPath` && \
124 $(MAKE
) DSTROOT
=$(DSTROOT
)$$ARM_PLATFORM DISABLE_USR_LINKS
=1 install
128 # installhdrs does nothing, because the headers aren't useful until
129 # the compiler is installed.
132 # We build and install in one shell script.
137 @echo
++++++++++++++++++++++
138 @echo
+ Installing sources
+
139 @echo
++++++++++++++++++++++
141 if
[ $(SRCROOT
) != .
]; then \
142 $(PAX
) -rw .
$(SRCROOT
); \
144 # LLVM LOCAL begin: Avoid verification error due to binaries in libjava.
145 rm -rf
"$(SRCROOT)/libjava/"
146 find
-d
"$(SRCROOT)" \
( -type d
-a
-name .svn
-o \
147 -type f
-a
-name .DS_Store
-o \
148 -name \
*~
-o
-name .\
#\* \) \
150 rm -rf
"$(SRCROOT)/gcc/testsuite"
151 rm -rf
"$(SRCROOT)/llvmCore/test"
153 #######################################################################
161 @if
[ -d
$(OBJROOT
) -a
"$(OBJROOT)" != / ]; then \
162 echo
'*** DELETING ' $(OBJROOT
); \
165 @if
[ -d
$(SYMROOT
) -a
"$(SYMROOT)" != / ]; then \
166 echo
'*** DELETING ' $(SYMROOT
); \
169 @if
[ -d
$(DSTROOT
) -a
"$(DSTROOT)" != / ]; then \
170 echo
'*** DELETING ' $(DSTROOT
); \
174 #######################################################################
176 $(OBJROOT
) $(SYMROOT
) $(DSTROOT
):
179 .PHONY
: install installsrc
clean llvmCore llvmgcc42 Embedded