forked from loarabia/Clang-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
50 lines (45 loc) · 1.08 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
CXX := clang++
LLVMCOMPONENTS := cppbackend
RTTIFLAG := -fno-rtti
#RTTIFLAG :=
CXXFLAGS := $(shell llvm-config --cxxflags) $(RTTIFLAG)
LLVMLDFLAGS := $(shell llvm-config --ldflags --libs $(LLVMCOMPONENTS))
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 = \
-lclangFrontendTool\
-lclangFrontend\
-lclangDriver\
-lclangSerialization\
-lclangCodeGen\
-lclangParse\
-lclangSema\
-lclangStaticAnalyzerFrontend\
-lclangStaticAnalyzerCheckers\
-lclangStaticAnalyzerCore\
-lclangAnalysis\
-lclangARCMigrate\
-lclangRewriteFrontend\
-lclangRewriteCore\
-lclangEdit\
-lclangAST\
-lclangLex\
-lclangBasic\
$(shell llvm-config --libs)
all: $(OBJECTS) $(EXES)
%: %.o
$(CXX) -o $@ $< $(CLANGLIBS) $(LLVMLDFLAGS)
clean:
-rm -f $(EXES) $(OBJECTS) *~