-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.in
107 lines (85 loc) · 3.07 KB
/
Makefile.in
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
CC:=@TARGET_COMPILER@
GCCPLUGINS_DIR:= $(shell $(CC) --print-file-name=plugin)
ARCH:= $(shell $(CC) -dumpmachine)
CXXFLAGS:=-std=gnu++20 -I. -Ilib -g -fPIC -fno-rtti -O2 -Wall -Wextra
ifeq ($(findstring aarch64, $(ARCH)), aarch64)
CXXFLAGS += -DSMTGCC_AARCH64
else ifeq ($(findstring riscv, $(ARCH)), riscv)
CXXFLAGS += -DSMTGCC_RISCV
endif
LIBS:=@LIBS@
.PHONY: all clean
tools = \
smtgcc-check-refine \
smtgcc-check-ub \
smtgcc-opt
plugins = \
smtgcc-check-refine.so \
smtgcc-tv.so
ifeq ($(findstring aarch64, $(ARCH)), aarch64)
plugins += smtgcc-tv-backend.so
else ifeq ($(findstring riscv, $(ARCH)), riscv)
plugins += smtgcc-tv-backend.so
endif
lib_sources = \
lib/cfg.cpp \
lib/check.cpp \
lib/dead_code_elimination.cpp \
lib/loop_unroll.cpp \
lib/memory_opt.cpp \
lib/read_aarch64.cpp \
lib/read_ir.cpp \
lib/read_riscv.cpp \
lib/simplify_insts.cpp \
lib/smt_cvc5.cpp \
lib/smt_z3.cpp \
lib/smtgcc.cpp \
lib/util.cpp \
lib/validate_ir.cpp \
lib/vrp.cpp
lib_objects = $(lib_sources:.cpp=.o)
tools_sources = \
tools/smtgcc-check-refine.cpp \
tools/smtgcc-check-ub.cpp \
tools/smtgcc-opt.cpp
tools_objects = $(tools_sources:.cpp=.o)
plugin_sources = \
plugin/gimple_conv.cpp \
plugin/smtgcc-check-refine.cpp \
plugin/smtgcc-tv-backend.cpp \
plugin/smtgcc-tv.cpp
ifeq ($(findstring aarch64, $(ARCH)), aarch64)
plugin_sources += plugin/aarch64.cpp
backend_objs = plugin/aarch64.o
else ifeq ($(findstring riscv, $(ARCH)), riscv)
plugin_sources += plugin/riscv.cpp
backend_objs = plugin/riscv.o
endif
plugin_objects = $(plugin_sources:.cpp=.o)
all: $(tools) $(plugins)
install: $(plugins)
for plugin in $(plugins); do \
install $$plugin $(GCCPLUGINS_DIR); \
done
clean:
rm -f $(lib_objects) $(tools_objects) $(plugin_objects) $(tools) $(plugins)
distclean: clean
rm -f Makefile config.h config.log config.status
$(lib_objects) $(tools_objects): config.h lib/smtgcc.h Makefile
$(lib_objects) $(tools_objects): %.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
$(plugin_objects): config.h lib/smtgcc.h plugin/gimple_conv.h Makefile
$(plugin_objects): %.o: %.cpp
$(CXX) $(CXXFLAGS) -I$(GCCPLUGINS_DIR)/include -c $< -o $@
smtgcc-check-refine: tools/smtgcc-check-refine.o $(lib_objects)
$(CXX) $(CXXFLAGS) tools/smtgcc-check-refine.o -o $@ $(lib_objects) $(LIBS)
smtgcc-check-ub: tools/smtgcc-check-ub.o $(lib_objects)
$(CXX) $(CXXFLAGS) tools/smtgcc-check-ub.o -o $@ $(lib_objects) $(LIBS)
smtgcc-opt: tools/smtgcc-opt.o $(lib_objects)
$(CXX) $(CXXFLAGS) tools/smtgcc-opt.o -o $@ $(lib_objects) $(LIBS)
smtgcc-check-refine.so: plugin/smtgcc-check-refine.o plugin/gimple_conv.o $(lib_objects)
$(CXX) $(CXXFLAGS) -shared plugin/smtgcc-check-refine.o plugin/gimple_conv.o $(lib_objects) -o $@ $(LIBS)
smtgcc-tv-backend.so: plugin/smtgcc-tv-backend.o plugin/gimple_conv.o $(backend_objs) $(lib_objects)
$(CXX) $(CXXFLAGS) -shared plugin/smtgcc-tv-backend.o plugin/gimple_conv.o $(backend_objs) $(lib_objects) -o $@ $(LIBS)
smtgcc-tv.so: plugin/smtgcc-tv.o plugin/gimple_conv.o $(lib_objects)
$(CXX) $(CXXFLAGS) -shared plugin/smtgcc-tv.o plugin/gimple_conv.o $(lib_objects) -o $@ $(LIBS)