-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
41 lines (32 loc) · 1.2 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
CLANGVERS=-4.0
LSAN_OPTIONS=detect_leaks=0
SAN = -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp
#SAN = -fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp
OBJS = \
Fuzzer/FuzzerCrossOver.o \
Fuzzer/FuzzerDriver.o \
Fuzzer/FuzzerIO.o \
Fuzzer/FuzzerLoop.o \
Fuzzer/FuzzerMutate.o \
Fuzzer/FuzzerSHA1.o \
Fuzzer/FuzzerTraceState.o \
Fuzzer/FuzzerUtil.o \
Fuzzer/FuzzerUtilDarwin.cpp \
Fuzzer/FuzzerUtilLinux.cpp \
Fuzzer/FuzzerExtFunctionsDlsym.cpp \
Fuzzer/FuzzerExtFunctionsWeak.cpp \
Fuzzer/FuzzerTracePC.cpp \
test_harness.o test_pg.o # fail_pg.o
all: test.so
%.o: %.cpp
clang++$(CLANGVERS) -g -O2 -fPIC -o $@ -c -std=c++11 $<
test_harness.o: test_harness.cpp
clang++$(CLANGVERS) -g -O0 -Wno-writable-strings -fPIC -c -std=c++11 $(SAN) test_harness.cpp
%.o: %.c
clang$(CLANGVERS) -g -O0 -I`/usr/local/pgsql/bin/pg_config --includedir-server` -fPIC -o $@ -c $(SAN) -Wno-ignored-attributes $<
test.so: $(OBJS)
clang++$(CLANGVERS) -fPIC -std=c++11 -shared -g -O0 -o test.so $(SAN) $(OBJS)
test: test.so
/usr/local/pgsql/bin/psql -c "select fuzz(10000, 'select \$$1')"
clean:
rm -f *.o *.so Fuzzer/*.o