Cleanup some comments in the OCaml bindings.
[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 # Default is optimized build.
45 ifeq ($(LLVM_DEBUG),1)
46 LLVM_OPTIMIZED := no
47 else
48 LLVM_OPTIMIZED := yes
49 endif
50
51 ifndef RC_ProjectSourceVersion
52 RC_ProjectSourceVersion = 9999
53 endif
54
55 ifndef RC_ProjectSourceSubversion
56 RC_ProjectSourceSubversion = 0
57 endif
58
59 # NOTE : Always put version numbers at the end because they are optional.
60 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
61         cd $(OBJROOT) && \
62           $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
63             $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
64             $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) \
65             $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) 
66
67
68 # installhdrs does nothing, because the headers aren't useful until
69 # the compiler is installed.
70 installhdrs:
71
72 # We build and install in one shell script.
73 build: 
74
75 installsrc:
76         @echo
77         @echo ++++++++++++++++++++++
78         @echo + Installing sources +
79         @echo ++++++++++++++++++++++
80         @echo
81         if [ $(SRCROOT) != . ]; then \
82           $(PAX) -rw . $(SRCROOT); \
83         fi
84         find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
85                                 -type f -a -name .DS_Store -o \
86                                 -name \*~ -o -name .\#\* \) \
87           -exec rm -rf {} \;
88
89 #######################################################################
90
91 clean:
92         @echo
93         @echo ++++++++++++
94         @echo + Cleaning +
95         @echo ++++++++++++
96         @echo
97         @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
98           echo '*** DELETING ' $(OBJROOT); \
99           rm -rf $(OBJROOT); \
100         fi
101         @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
102           echo '*** DELETING ' $(SYMROOT); \
103           rm -rf $(SYMROOT); \
104         fi
105         @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
106           echo '*** DELETING ' $(DSTROOT); \
107           rm -rf $(DSTROOT); \
108         fi
109
110 #######################################################################
111
112 $(OBJROOT) $(SYMROOT) $(DSTROOT):
113         mkdir -p $@
114
115 .PHONY: install installsrc clean