forked from greensky00/skiplist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (65 loc) · 1.72 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
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
LDFLAGS = -pthread
CFLAGS = \
-g -D_GNU_SOURCE \
-I. -I./src -I./debug -I./include -I./examples -I./tests \
-fPIC \
CFLAGS += -Wall
CFLAGS += -O3
#CFLAGS += -fsanitize=address -fuse-ld=gold
CXXFLAGS = $(CFLAGS) \
--std=c++11 \
SKIPLIST = src/skiplist.o
SHARED_LIB = libskiplist.so
STATIC_LIB = libskiplist.a
TEST = \
tests/skiplist_test.o \
$(STATIC_LIB) \
MT_TEST = \
tests/mt_test.o \
$(STATIC_LIB) \
STL_MAP_COMPARE = \
tests/stl_map_compare.o \
$(STATIC_LIB) \
CONTAINER_TEST = \
tests/container_test.o \
$(STATIC_LIB) \
PURE_C_EXAMPLE = \
examples/pure_c_example.o \
$(STATIC_LIB) \
CPP_MAP_EXAMPLE = \
examples/cpp_map_example.o \
$(STATIC_LIB) \
CPP_SET_EXAMPLE = \
examples/cpp_set_example.o \
$(STATIC_LIB) \
PROGRAMS = \
tests/skiplist_test \
tests/mt_test \
tests/container_test \
tests/stl_map_compare \
examples/pure_c_example \
examples/cpp_set_example \
examples/cpp_map_example \
libskiplist.so \
libskiplist.a \
all: $(PROGRAMS)
libskiplist.so: $(SKIPLIST)
$(CXX) $(CXXFLAGS) -shared $(LDBFALGS) -o $(SHARED_LIB) $(SKIPLIST)
libskiplist.a: $(SKIPLIST)
ar rcs $(STATIC_LIB) $(SKIPLIST)
tests/skiplist_test: $(TEST)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
tests/mt_test: $(MT_TEST)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
tests/container_test: $(CONTAINER_TEST)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
tests/stl_map_compare: $(STL_MAP_COMPARE)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
examples/pure_c_example: $(PURE_C_EXAMPLE)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
examples/cpp_map_example: $(CPP_MAP_EXAMPLE)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
examples/cpp_set_example: $(CPP_SET_EXAMPLE)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
clean:
rm -rf $(PROGRAMS) ./*.o ./*.so ./*/*.o ./*/*.so