-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
50 lines (36 loc) · 1.59 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
# Build C++ code that uses the clang libraries, and thus need the LLVM config flags
CXX_WITH_LLVM_CONFIG=\
g++ ${CFLAGS_GCC} `llvm-config-64 --cxxflags` -O2 -g "$<" -o "$@" -c -Wall -Wextra -Wno-unused -Wno-strict-aliasing -Werror
CXX_LINK_WITH_LLVM_CONFIG=\
g++ ${LDFLAGS_GCC} `llvm-config-64 --ldflags` -O2 -g \
$^ -o "$@" -lffi -lm -ltinfo -lz -lpthread -ldl
MKDIR=mkdir -p
.PHONY: default clean tests
default: clang_plugins.so
PLUGINS={large_assignment,tagged_union,include_cleaner,private,enums_conversion,warn_unused_result}
tests: clang_plugins.so
make -f enums_conversion/test/include.mk
make -f include_cleaner/test/include.mk
make -f large_assignment/test/include.mk
make -f warn_unused_result/test/include.mk
clean:
make -f enums_conversion/test/include.mk clean
make -f include_cleaner/test/include.mk clean
make -f large_assignment/test/include.mk clean
make -f warn_unused_result/test/include.mk clean
rm -f *.o clang_plugins.so
enums_conversion.o: enums_conversion/enums_conversion.cpp
${CXX_WITH_LLVM_CONFIG}
large_assignment.o: large_assignment/large_assignment.cpp
${CXX_WITH_LLVM_CONFIG}
tagged_union.o: tagged_union/tagged_union.cpp
${CXX_WITH_LLVM_CONFIG}
include_cleaner.o: include_cleaner/include_cleaner.cpp
${CXX_WITH_LLVM_CONFIG}
private.o: private/private.cpp
${CXX_WITH_LLVM_CONFIG}
warn_unused_result.o: warn_unused_result/warn_unused_result.cpp
${CXX_WITH_LLVM_CONFIG}
# tagged_union.o
clang_plugins.so: enums_conversion.o large_assignment.o include_cleaner.o private.o warn_unused_result.o
${CXX_LINK_WITH_LLVM_CONFIG} -fpic -shared -lclangASTMatchers