forked from loarabia/Clang-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
44 lines (40 loc) · 949 Bytes
/
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
CXX := clang++
LLVMCOMPONENTS := cppbackend
RTTIFLAG := -fno-rtti
#RTTIFLAG :=
CXXFLAGS := $(shell llvm-config --cxxflags) $(RTTIFLAG)
LLVMLDFLAGS := $(shell llvm-config --ldflags --libs $(LLVMCOMPONENTS))
DDD := $(shell echo $(LLVMLDFLAGS))
SOURCES = tutorial1.cpp \
tutorial2.cpp \
tutorial3.cpp \
tutorial4.cpp \
tutorial6.cpp \
CItutorial1.cpp \
CItutorial2.cpp \
CItutorial3.cpp \
CItutorial4.cpp \
CItutorial6.cpp \
CIBasicRecursiveASTVisitor.cpp \
CIrewriter.cpp
OBJECTS = $(SOURCES:.cpp=.o)
EXES = $(OBJECTS:.o=)
CLANGLIBS = \
-lclangFrontend \
-lclangDriver \
-lclangSerialization \
-lclangParse \
-lclangSema \
-lclangAnalysis \
-lclangRewrite \
-lclangEdit \
-lclangAST \
-lclangLex \
-lclangBasic \
-lLLVMMC \
-lLLVMSupport
all: $(OBJECTS) $(EXES)
%: %.o
$(CXX) -o $@ $< $(CLANGLIBS) $(LLVMLDFLAGS)
clean:
-rm -f $(EXES) $(OBJECTS) *~