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 defaults to enabled.
53 # LLVM gets installed into /Developer/usr/local, not /usr.
55 PREFIX
= /Developer
/usr
/llvm-gcc-4.2
57 PREFIX
= ${DEVELOPER_DIR}/usr
/llvm-gcc-4.2
63 # Unless assertions are forced on in the GMAKE command line, disable them.
64 ifdef ENABLE_ASSERTIONS
65 LLVM_ASSERTIONS
:= yes
72 LLVMCORE_PATH
= /Developer
/usr
/local
74 LLVMCORE_PATH
= ${DEVELOPER_DIR}/usr
/local
78 ifndef RC_ProjectSourceVersion
79 RC_ProjectSourceVersion
= 9999
82 ifndef RC_ProjectSourceSubversion
83 RC_ProjectSourceSubversion
= 00
86 install: $(OBJROOT
) $(SYMROOT
) $(DSTROOT
)
88 $(SRC
)/build_gcc
"$(RC_ARCHS)" "$(TARGETS)" \
89 $(SRC
) $(PREFIX
) $(DSTROOT
) $(SYMROOT
) $(ENABLE_LLVM
) \
90 $(LLVM_ASSERTIONS
) $(LLVMCORE_PATH
) \
91 $(RC_ProjectSourceVersion
) $(RC_ProjectSourceSubversion
)
95 # installhdrs does nothing, because the headers aren't useful until
96 # the compiler is installed.
99 # We build and install in one shell script.
104 @echo
++++++++++++++++++++++
105 @echo
+ Installing sources
+
106 @echo
++++++++++++++++++++++
108 if
[ $(SRCROOT
) != .
]; then \
109 $(PAX
) -rw .
$(SRCROOT
); \
111 # LLVM LOCAL begin: Avoid verification error due to binaries in libjava.
112 rm -rf
"$(SRCROOT)/libjava/"
113 find
-d
"$(SRCROOT)" \
( -type d
-a
-name CVS
-o \
114 -type f
-a
-name .DS_Store
-o \
115 -name \
*~
-o
-name .\
#\* \) \
118 #######################################################################
126 @if
[ -d
$(OBJROOT
) -a
"$(OBJROOT)" != / ]; then \
127 echo
'*** DELETING ' $(OBJROOT
); \
130 @if
[ -d
$(SYMROOT
) -a
"$(SYMROOT)" != / ]; then \
131 echo
'*** DELETING ' $(SYMROOT
); \
134 @if
[ -d
$(DSTROOT
) -a
"$(DSTROOT)" != / ]; then \
135 echo
'*** DELETING ' $(DSTROOT
); \
139 #######################################################################
141 $(OBJROOT
) $(SYMROOT
) $(DSTROOT
):
144 .PHONY
: install installsrc
clean