Declare block/closure byref variable at function scope.
[llvm-gcc-4.2.git] / GNUmakefile
blob33a9df47b9754c403c5c903be679b515206d1f4f
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:
19 @echo
20 @echo "Error: llvm-gcc cannot be built in the source directory."
21 @echo "Please follow the instructions in the README.LLVM file."
22 @exit 1
24 # Include the set of standard Apple makefile definitions.
25 ifndef CoreOSMakefiles
26 CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
27 endif
28 include $(CoreOSMakefiles)/Standard/Standard.make
30 # Enable Apple extensions to (gnu)make.
31 USE_APPLE_PB_SUPPORT = all
33 RC_ARCHS := ppc i386
34 HOSTS = $(RC_ARCHS)
35 targets = echo $(RC_ARCHS)
36 TARGETS := $(shell $(targets))
38 SRCROOT = .
40 SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
41 OBJROOT = $(SRC)/obj
42 SYMROOT = $(OBJROOT)/../sym
43 DSTROOT = $(OBJROOT)/../dst
45 PREFIX = /usr
47 #######################################################################
49 # LLVM LOCAL begin
50 # LLVM defaults to enabled.
51 ifndef DISABLE_LLVM
52 ENABLE_LLVM = true
53 # LLVM gets installed into /Developer/usr/local, not /usr.
54 ifndef DEVELOPER_DIR
55 PREFIX = /Developer/usr/llvm-gcc-4.2
56 else
57 PREFIX = ${DEVELOPER_DIR}/usr/llvm-gcc-4.2
58 endif
59 else
60 ENABLE_LLVM = false
61 endif
63 # Unless assertions are forced on in the GMAKE command line, disable them.
64 ifdef ENABLE_ASSERTIONS
65 LLVM_ASSERTIONS := yes
66 else
67 LLVM_ASSERTIONS := no
68 endif
70 ifndef LLVMCORE_PATH
71 ifndef DEVELOPER_DIR
72 LLVMCORE_PATH = /Developer/usr/local
73 else
74 LLVMCORE_PATH = ${DEVELOPER_DIR}/usr/local
75 endif
76 endif
78 ifndef RC_ProjectSourceVersion
79 RC_ProjectSourceVersion = 9999
80 endif
82 ifndef RC_ProjectSourceSubversion
83 RC_ProjectSourceSubversion = 00
84 endif
86 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
87 cd $(OBJROOT) && \
88 $(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
89 $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(ENABLE_LLVM) \
90 $(LLVM_ASSERTIONS) $(LLVMCORE_PATH) \
91 $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
93 # LLVM LOCAL end
95 # installhdrs does nothing, because the headers aren't useful until
96 # the compiler is installed.
97 installhdrs:
99 # We build and install in one shell script.
100 build:
102 installsrc:
103 @echo
104 @echo ++++++++++++++++++++++
105 @echo + Installing sources +
106 @echo ++++++++++++++++++++++
107 @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 .\#\* \) \
116 -exec rm -rf {} \;
118 #######################################################################
120 clean:
121 @echo
122 @echo ++++++++++++
123 @echo + Cleaning +
124 @echo ++++++++++++
125 @echo
126 @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
127 echo '*** DELETING ' $(OBJROOT); \
128 rm -rf $(OBJROOT); \
130 @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
131 echo '*** DELETING ' $(SYMROOT); \
132 rm -rf $(SYMROOT); \
134 @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
135 echo '*** DELETING ' $(DSTROOT); \
136 rm -rf $(DSTROOT); \
139 #######################################################################
141 $(OBJROOT) $(SYMROOT) $(DSTROOT):
142 mkdir -p $@
144 .PHONY: install installsrc clean