Mercurial > hg
comparison contrib/fuzz/Makefile @ 38230:bf901559e647
fuzz: expand variables by make
Otherwise it wouldn't work unless CC and CXX were exported from the
environment.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Jun 2018 13:11:22 +0900 |
parents | fbe239064064 |
children | 4dd3b6c68f96 |
comparison
equal
deleted
inserted
replaced
38229:7701c2d4a438 | 38230:bf901559e647 |
---|---|
1 CC = clang | |
2 CXX = clang++ | |
3 | |
1 fuzzutil.o: fuzzutil.cc fuzzutil.h | 4 fuzzutil.o: fuzzutil.cc fuzzutil.h |
2 $$CXX $$CXXFLAGS -g -O1 -fsanitize=fuzzer-no-link,address \ | 5 $(CXX) $(CXXFLAGS) -g -O1 -fsanitize=fuzzer-no-link,address \ |
3 -std=c++17 \ | 6 -std=c++17 \ |
4 -I../../mercurial -c -o fuzzutil.o fuzzutil.cc | 7 -I../../mercurial -c -o fuzzutil.o fuzzutil.cc |
5 | 8 |
6 fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h | 9 fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h |
7 $$CXX $$CXXFLAGS -std=c++17 \ | 10 $(CXX) $(CXXFLAGS) -std=c++17 \ |
8 -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc | 11 -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc |
9 | 12 |
10 bdiff.o: ../../mercurial/bdiff.c | 13 bdiff.o: ../../mercurial/bdiff.c |
11 $$CC $$CFLAGS -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ | 14 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ |
12 ../../mercurial/bdiff.c | 15 ../../mercurial/bdiff.c |
13 | 16 |
14 bdiff: bdiff.cc bdiff.o fuzzutil.o | 17 bdiff: bdiff.cc bdiff.o fuzzutil.o |
15 $$CXX $$CXXFLAGS -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | 18 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
16 -std=c++17 \ | 19 -std=c++17 \ |
17 -I../../mercurial bdiff.cc bdiff.o fuzzutil.o -o bdiff | 20 -I../../mercurial bdiff.cc bdiff.o fuzzutil.o -o bdiff |
18 | 21 |
19 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c | 22 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c |
20 $$CC $$CFLAGS -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c | 23 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c |
21 | 24 |
22 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o | 25 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o |
23 $$CXX $$CXXFLAGS -std=c++17 -I../../mercurial bdiff.cc \ | 26 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ |
24 bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \ | 27 bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \ |
25 $$OUT/bdiff_fuzzer | 28 $$OUT/bdiff_fuzzer |
26 | 29 |
27 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | 30 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
28 $$CC -g -O1 -fsanitize=fuzzer-no-link,address -c \ | 31 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ |
29 -o $@ \ | 32 -o $@ \ |
30 $< | 33 $< |
31 | 34 |
32 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o | 35 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o |
33 $$CXX $$CXXFLAGS -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | 36 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
34 -I../../mercurial xdiff.cc \ | 37 -I../../mercurial xdiff.cc \ |
35 xdiffi.o xprepare.o xutils.o fuzzutil.o -o xdiff | 38 xdiffi.o xprepare.o xutils.o fuzzutil.o -o xdiff |
36 | 39 |
37 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | 40 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
38 $$CC $$CFLAGS -c \ | 41 $(CC) $(CFLAGS) -c \ |
39 -o $@ \ | 42 -o $@ \ |
40 $< | 43 $< |
41 | 44 |
42 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o | 45 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o |
43 $$CXX $$CXXFLAGS -std=c++17 -I../../mercurial xdiff.cc \ | 46 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ |
44 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o \ | 47 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o \ |
45 -lFuzzingEngine -o $$OUT/xdiff_fuzzer | 48 -lFuzzingEngine -o $$OUT/xdiff_fuzzer |
46 | 49 |
47 all: bdiff xdiff | 50 all: bdiff xdiff |
48 | 51 |