-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 1.02 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
CC = clang
CXX = clang++
REPORTER_INC = -I$(shell pwd)/include
LLVM_INC = -I$(HOME)/clang+llvm/include
LLVM_LIB = -I$(HOME)/clang+llvm/lib
REPORT_FLAGS = -Xclang -load -Xclang ./libReportPass.so -flegacy-pass-manager
all: clean example
reporter.stdc++.o:
$(CXX) -g $(REPORTER_INC) -c reporter.cpp -o reporter.stdc++.o -stdlib=libstdc++
reporter.c++.o:
$(CXX) -g $(REPORTER_INC) -c reporter.cpp -o reporter.c++.o -stdlib=libc++
libreporter.so:
$(CXX) -g -shared -fPIC $(REPORTER_INC) reporter.cpp -o libreporter.so
pass:
$(CXX) -g -shared -fPIC $(LLVM_INC) $(LLVM_LIB) -o libReportPass.so report/Report.cpp -fno-rtti
lib.o: lib.h pass
$(CC) $(REPORT_FLAGS) -g -c lib.c
example: reporter.stdc++.o reporter.c++.o lib.o pass libreporter.so
$(CC) -Xclang -disable-O0-optnone $(REPORT_FLAGS) example.cpp lib.o reporter.stdc++.o -lstdc++ -o example
debug: reporter.stdc++.o lib.o pass
$(CC) -Xclang -disable-O0-optnone $(REPORT_FLAGS) example.cpp lib.o reporter.stdc++.o -lstdc++ -o example
clean:
rm -f *.o example *.ll *.json *.a *.so