-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile
159 lines (144 loc) · 3.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
SVN=/usr/bin/svn
LLVM_RELEASE="RELEASE_31/final"
CLANG_RELEASE="RELEASE_31/final"
LLVM_URL="http://llvm.org/svn/llvm-project/llvm"
CLANG_URL="http://llvm.org/svn/llvm-project/cfe"
#CLANG=../build/Debug+Asserts/bin/clang++
CLANG=g++
# LDFLAGS is modified from `llvm-config --libs`
# -- certain libs were not found for some reason or another...
LDFLAGS=-lclangFrontend \
-lclangDriver \
-lclangSerialization \
-lclangParse \
-lclangSema \
-lclangAnalysis \
-lclangRewrite \
-lclangEdit \
-lclangAST \
-lclangLex \
-lclangBasic \
-lLLVMAsmParser \
-lLLVMInstrumentation \
-lLLVMLinker \
-lLLVMArchive \
-lLLVMBitReader \
-lLLVMDebugInfo \
-lLLVMJIT \
-lLLVMipo \
-lLLVMVectorize \
-lLLVMBitWriter \
-lLLVMTableGen \
-lLLVMHexagonCodeGen \
-lLLVMHexagonDesc \
-lLLVMHexagonInfo \
-lLLVMHexagonAsmPrinter \
-lLLVMMBlazeDisassembler \
-lLLVMMBlazeAsmParser \
-lLLVMMBlazeCodeGen \
-lLLVMMBlazeDesc \
-lLLVMMBlazeInfo \
-lLLVMMBlazeAsmPrinter \
-lLLVMCppBackendCodeGen \
-lLLVMCppBackendInfo \
-lLLVMMSP430CodeGen \
-lLLVMMSP430Desc \
-lLLVMMSP430Info \
-lLLVMMSP430AsmPrinter \
-lLLVMXCoreCodeGen \
-lLLVMXCoreDesc \
-lLLVMXCoreInfo \
-lLLVMCellSPUCodeGen \
-lLLVMCellSPUDesc \
-lLLVMCellSPUInfo \
-lLLVMMipsCodeGen \
-lLLVMMipsAsmParser \
-lLLVMMipsDisassembler \
-lLLVMMipsDesc \
-lLLVMMipsInfo \
-lLLVMMipsAsmPrinter \
-lLLVMARMDisassembler \
-lLLVMARMAsmParser \
-lLLVMARMCodeGen \
-lLLVMARMDesc \
-lLLVMARMInfo \
-lLLVMARMAsmPrinter \
-lLLVMPowerPCCodeGen \
-lLLVMPowerPCDesc \
-lLLVMPowerPCInfo \
-lLLVMPowerPCAsmPrinter \
-lLLVMSparcCodeGen \
-lLLVMSparcDesc \
-lLLVMSparcInfo \
-lLLVMX86AsmParser \
-lLLVMX86Disassembler \
-lLLVMX86CodeGen \
-lLLVMSelectionDAG \
-lLLVMAsmPrinter \
-lLLVMX86Desc \
-lLLVMX86Info \
-lLLVMX86AsmPrinter \
-lLLVMX86Utils \
-lgtest_main \
-lgtest \
-lLLVMMCDisassembler \
-lLLVMMCParser \
-lLLVMInterpreter \
-lLLVMCodeGen \
-lLLVMScalarOpts \
-lLLVMInstCombine \
-lLLVMTransformUtils \
-lLLVMipa \
-lLLVMAnalysis \
-lLLVMMCJIT \
-lLLVMRuntimeDyld \
-lLLVMExecutionEngine \
-lLLVMTarget \
-lLLVMMC \
-lLLVMObject \
-lLLVMCore \
-lLLVMSupport
CLANGFLAGS=`../build/Debug+Asserts/bin/llvm-config --cxxflags --ldflags`
CFLAGS=-L ../build/Debug+Asserts/lib \
-I`../build/Debug+Asserts/bin/llvm-config --includedir` \
-I ../llvm/tools/clang/include \
-I ../build/include \
-I ../build/tools/clang/include
SCAFFOLD=scaffold
UNAME_S := $(shell uname -s)
all: Clang
Clang: llvm build
@cd llvm/tools && /bin/rm -f clang && /bin/ln -s ../../clang;
@cd clang && /bin/rm -f build && /bin/ln -s ../build;
@if [ -z $(USE_GCC) ]; then \
if [ "$(UNAME_S)" = "Darwin" ]; then \
cd build && ../llvm/configure --disable-debug-symbols && make ENABLE_LIBCPP=1; \
else \
cd build && ../llvm/configure --disable-debug-symbols && make ; \
fi \
else \
if [ "$(UNAME_S)" = "Darwin" ]; then \
mkdir -p build && cd build && ../llvm/configure --disable-debug-symbols CC=gcc CXX=g++ && make ENABLE_LIBCPP=1; \
else \
mkdir -p build && cd build && ../llvm/configure --disable-debug-symbols CC=gcc CXX=g++ && make ; \
fi \
fi
@if [ -z `echo ${PATH} | grep ${PWD}/Debug+Asserts/bin` ]; then \
export PATH=${PATH}:${PWD}/Debug+Asserts/bin; \
else true; fi
@if [ -z `echo ${PATH} | grep ${PWD}/Debug+Asserts/bin` ]; then \
export PATH=${PATH}:${PWD}/Debug+Asserts/bin; \
else true; fi
build: llvm
@mkdir -p build
llvm:
@if [ ! -e $(SVN) ]; then \
echo "Please install Subversion: 'sudo apt-get install subversion'"; exit 2; \
else true; fi
@$(SVN) checkout --force $(LLVM_URL)/tags/$(LLVM_RELEASE) llvm;
Scaffold:
@cd scaffold && make;
clean:
#cd scaffold && make clean
@if [ -d build ]; then cd build && make clean; fi
.PHONY: clean Scaffold Clang