blob: 400d97a0c09d338c6e3066e5b9ba74a5a9f9e0a9 [file] [log] [blame]
Bill Wendlingce6822a2007-11-09 06:59:33 +00001# LLVM LOCAL file build machinery
2# LLVM Compiler Makefile for use by buildit.
3#
4# This makefile is intended only for use with B&I buildit. For "normal" builds
5# use the conventional top-level makefile.
6#
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# targetted at this host gets built anyway, but not installed unless it's listed
10# in TARGETS.
11
12# Include the set of standard Apple makefile definitions.
13ifndef CoreOSMakefiles
14CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
15endif
16include $(CoreOSMakefiles)/Standard/Standard.make
17
18# Enable Apple extensions to (gnu)make.
19USE_APPLE_PB_SUPPORT = all
20
21RC_ARCHS := ppc i386
22HOSTS = $(RC_ARCHS)
23targets = echo $(RC_ARCHS)
24TARGETS := $(shell $(targets))
25
26SRCROOT = .
27
28SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
29OBJROOT = $(SRC)/obj
30SYMROOT = $(OBJROOT)/../sym
31DSTROOT = $(OBJROOT)/../dst
32
33#######################################################################
34
35PREFIX = /usr/local
36
37# Unless assertions are forced on in the GMAKE command line, disable them.
38ifdef ENABLE_ASSERTIONS
39LLVM_ASSERTIONS := yes
40else
41LLVM_ASSERTIONS := no
42endif
43
Evan Cheng1a7fdae2008-01-18 21:01:00 +000044# Default is optimized build.
45ifeq ($(LLVM_DEBUG),1)
46LLVM_OPTIMIZED := no
47else
48LLVM_OPTIMIZED := yes
49endif
50
Bill Wendlingce6822a2007-11-09 06:59:33 +000051ifndef RC_ProjectSourceVersion
52RC_ProjectSourceVersion = 9999
53endif
54
55ifndef RC_ProjectSourceSubversion
56RC_ProjectSourceSubversion = 01
57endif
58
59install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
60 cd $(OBJROOT) && \
61 $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
62 $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
63 $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \
Evan Cheng1a7fdae2008-01-18 21:01:00 +000064 $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED)
Bill Wendlingce6822a2007-11-09 06:59:33 +000065
66# installhdrs does nothing, because the headers aren't useful until
67# the compiler is installed.
68installhdrs:
69
70# We build and install in one shell script.
71build:
72
73installsrc:
74 @echo
75 @echo ++++++++++++++++++++++
76 @echo + Installing sources +
77 @echo ++++++++++++++++++++++
78 @echo
79 if [ $(SRCROOT) != . ]; then \
80 $(PAX) -rw . $(SRCROOT); \
81 fi
82 find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
83 -type f -a -name .DS_Store -o \
84 -name \*~ -o -name .\#\* \) \
85 -exec rm -rf {} \;
86
87#######################################################################
88
89clean:
90 @echo
91 @echo ++++++++++++
92 @echo + Cleaning +
93 @echo ++++++++++++
94 @echo
95 @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
96 echo '*** DELETING ' $(OBJROOT); \
97 rm -rf $(OBJROOT); \
98 fi
99 @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
100 echo '*** DELETING ' $(SYMROOT); \
101 rm -rf $(SYMROOT); \
102 fi
103 @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
104 echo '*** DELETING ' $(DSTROOT); \
105 rm -rf $(DSTROOT); \
106 fi
107
108#######################################################################
109
110$(OBJROOT) $(SYMROOT) $(DSTROOT):
111 mkdir -p $@
112
113.PHONY: install installsrc clean