Mike Stump pointed out that I can't use autoconf 2.61 here;
[llvm-gcc-4.2.git] / GNUmakefile
blob134923d067a65b8333b8bc6ce448e470af4a3796
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, enable them.
64 ifndef ENABLE_ASSERTIONS
65 ENABLE_ASSERTIONS := yes
66 endif
68 ifndef LLVMCORE_PATH
69 ifndef DEVELOPER_DIR
70 LLVMCORE_PATH = /Developer/usr/local
71 else
72 LLVMCORE_PATH = ${DEVELOPER_DIR}/usr/local
73 endif
74 endif
76 ifndef RC_ProjectSourceVersion
77 RC_ProjectSourceVersion = 9999
78 endif
80 ifndef RC_ProjectSourceSubversion
81 RC_ProjectSourceSubversion = 00
82 endif
84 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
85 cd $(OBJROOT) && \
86 $(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
87 $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(ENABLE_LLVM) \
88 $(ENABLE_ASSERTIONS) $(LLVMCORE_PATH) \
89 $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
91 # LLVM LOCAL end
93 # installhdrs does nothing, because the headers aren't useful until
94 # the compiler is installed.
95 installhdrs:
97 # We build and install in one shell script.
98 build:
100 installsrc:
101 @echo
102 @echo ++++++++++++++++++++++
103 @echo + Installing sources +
104 @echo ++++++++++++++++++++++
105 @echo
106 if [ $(SRCROOT) != . ]; then \
107 $(PAX) -rw . $(SRCROOT); \
109 # LLVM LOCAL begin: Avoid verification error due to binaries in libjava.
110 rm -rf "$(SRCROOT)/libjava/"
111 find -d "$(SRCROOT)" \( -type d -a -name CVS -o \
112 -type f -a -name .DS_Store -o \
113 -name \*~ -o -name .\#\* \) \
114 -exec rm -rf {} \;
116 #######################################################################
118 clean:
119 @echo
120 @echo ++++++++++++
121 @echo + Cleaning +
122 @echo ++++++++++++
123 @echo
124 @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
125 echo '*** DELETING ' $(OBJROOT); \
126 rm -rf $(OBJROOT); \
128 @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
129 echo '*** DELETING ' $(SYMROOT); \
130 rm -rf $(SYMROOT); \
132 @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
133 echo '*** DELETING ' $(DSTROOT); \
134 rm -rf $(DSTROOT); \
137 #######################################################################
139 $(OBJROOT) $(SYMROOT) $(DSTROOT):
140 mkdir -p $@
142 .PHONY: install installsrc clean