-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
78 lines (51 loc) · 1.88 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
CFLAGSW_GCC = -Wall -Wextra -Wno-missing-field-initializers \
-Wno-parentheses -Wno-missing-braces \
-Wmissing-prototypes -Wfloat-equal \
-Wwrite-strings -Wpointer-arith -Wcast-align \
-Wnull-dereference \
-Werror=multichar -Werror=sizeof-pointer-memaccess -Werror=return-type \
-fstrict-aliasing
CXXFLAGSW_GCC = -Wall -Wextra -Wno-missing-field-initializers \
-Wno-parentheses -Wno-missing-braces \
-Wno-unused-local-typedefs \
-Wfloat-equal \
-Wpointer-arith -Wcast-align \
-Wnull-dereference \
-Wnon-virtual-dtor -Wmissing-declarations \
-Werror=multichar -Werror=sizeof-pointer-memaccess -Werror=return-type \
-Werror=delete-non-virtual-dtor \
-fstrict-aliasing
#CXXFLAGSO = -Og -fsanitize=address -g
#CXXFLAGSO = -O2
CXXFLAGSO = -g
#CFLAGSO = -g -fsanitize=address
CFLAGSO = -g
#CFLAGSO = -O3 -march=native
#LDFLAGS = -g -fsanitize=address
CXXFLAGS += $(CXXFLAGSW_GCC)
CXXFLAGS += $(CXXFLAGSO)
CFLAGS += $(CFLAGSW_GCC) $(CFLAGSO)
CPPFLAGS = -Ifastmod/include
PYBIND11_CPPFLAGS := $(shell python3 -m pybind11 --includes)
PY_EXT_SUFFIX := $(shell python3-config --extension-suffix)
.PHONY: all
all: divide$(PY_EXT_SUFFIX) fastmod$(PY_EXT_SUFFIX)
divide$(PY_EXT_SUFFIX): pydivide.cc
$(CXX) $(PYBIND11_CPPFLAGS) $(CXXFLAGS) -shared -fPIC $< -o $@
TEMP += divide$(PY_EXT_SUFFIX)
fastmod$(PY_EXT_SUFFIX): pyfastmod.cc
$(CXX) $(PYBIND11_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -shared -fPIC $< -o $@
TEMP += fastmod$(PY_EXT_SUFFIX)
test_hash_table: test_hash_table.o phash_table.o instrument.o
TEMP += test_hash_table test_hash_table.o phash_table.o instrument.o
testxx: testxx.o phash_table.o
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
TEMP += testxx testxx.o phash_table.o
TEMP += libphash-lookup.svg libphash-lookup.pdf
%.pdf: %.dot
dot -Tpdf $<.dot -o$@.pdf
%.svg: %.dot
dot -Tsvg $<.dot -o$@.svg
.PHONY: clean
clean:
rm -rf $(TEMP)