Fix whitespace.
[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 ifndef ENABLE_ASSERTIONS
39 ENABLE_ASSERTIONS := no
40 endif
41
42 # Default is optimized build.
43 ifeq ($(LLVM_DEBUG),1)
44 LLVM_OPTIMIZED := no
45 else
46 LLVM_OPTIMIZED := yes
47 endif
48
49 ifndef RC_ProjectSourceVersion
50 RC_ProjectSourceVersion = 9999
51 endif
52
53 ifndef RC_ProjectSourceSubversion
54 RC_ProjectSourceSubversion = 0
55 endif
56
57 # NOTE : Always put version numbers at the end because they are optional.
58 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
59         cd $(OBJROOT) && \
60           $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
61           $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
62           $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) \
63           $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) 
64
65 # installhdrs does nothing, because the headers aren't useful until
66 # the compiler is installed.
67 installhdrs:
68
69 # We build and install in one shell script.
70 build: 
71
72 installsrc:
73         @echo
74         @echo ++++++++++++++++++++++
75         @echo + Installing sources +
76         @echo ++++++++++++++++++++++
77         @echo
78         if [ $(SRCROOT) != . ]; then \
79           $(PAX) -rw . $(SRCROOT); \
80         fi
81         find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
82                                 -type f -a -name .DS_Store -o \
83                                 -name \*~ -o -name .\#\* \) \
84           -exec rm -rf {} \;
85         rm -rf "$(SRCROOT)/test"
86
87 #######################################################################
88
89 clean:
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