Change LinkTimeOptimizer.h install location.
[oota-llvm.git] / utils / buildit / GNUmakefile
1 # 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.
13 ifndef CoreOSMakefiles
14 CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
15 endif
16 include $(CoreOSMakefiles)/Standard/Standard.make
17
18 # Enable Apple extensions to (gnu)make.
19 USE_APPLE_PB_SUPPORT = all
20
21 RC_ARCHS := ppc i386
22 HOSTS = $(RC_ARCHS)
23 targets = echo $(RC_ARCHS)
24 TARGETS := $(shell $(targets))
25
26 SRCROOT = .
27
28 SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
29 OBJROOT = $(SRC)/obj
30 SYMROOT = $(OBJROOT)/../sym
31 DSTROOT = $(OBJROOT)/../dst
32
33 #######################################################################
34
35 PREFIX = /usr/local
36
37 # Unless assertions are forced on in the GMAKE command line, disable them.
38 ifdef ENABLE_ASSERTIONS
39 LLVM_ASSERTIONS := yes
40 else
41 LLVM_ASSERTIONS := no
42 endif
43
44 ifndef RC_ProjectSourceVersion
45 RC_ProjectSourceVersion = 9999
46 endif
47
48 ifndef RC_ProjectSourceSubversion
49 RC_ProjectSourceSubversion = 01
50 endif
51
52 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
53         cd $(OBJROOT) && \
54           $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
55             $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
56             $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \
57             $(LLVM_ASSERTIONS)
58
59 # installhdrs does nothing, because the headers aren't useful until
60 # the compiler is installed.
61 installhdrs:
62
63 # We build and install in one shell script.
64 build: 
65
66 installsrc:
67         @echo
68         @echo ++++++++++++++++++++++
69         @echo + Installing sources +
70         @echo ++++++++++++++++++++++
71         @echo
72         if [ $(SRCROOT) != . ]; then \
73           $(PAX) -rw . $(SRCROOT); \
74         fi
75         find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
76                                 -type f -a -name .DS_Store -o \
77                                 -name \*~ -o -name .\#\* \) \
78           -exec rm -rf {} \;
79
80 #######################################################################
81
82 clean:
83         @echo
84         @echo ++++++++++++
85         @echo + Cleaning +
86         @echo ++++++++++++
87         @echo
88         @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
89           echo '*** DELETING ' $(OBJROOT); \
90           rm -rf $(OBJROOT); \
91         fi
92         @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
93           echo '*** DELETING ' $(SYMROOT); \
94           rm -rf $(SYMROOT); \
95         fi
96         @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
97           echo '*** DELETING ' $(DSTROOT); \
98           rm -rf $(DSTROOT); \
99         fi
100
101 #######################################################################
102
103 $(OBJROOT) $(SYMROOT) $(DSTROOT):
104         mkdir -p $@
105
106 .PHONY: install installsrc clean