##// END OF EJS Templates
fuzz: fix "make clean" to pass even if no binaries built yet
Yuya Nishihara -
r38236:9db30f43 default
parent child Browse files
Show More
@@ -1,60 +1,60 b''
1 CC = clang
1 CC = clang
2 CXX = clang++
2 CXX = clang++
3
3
4 all: bdiff xdiff
4 all: bdiff xdiff
5
5
6 fuzzutil.o: fuzzutil.cc fuzzutil.h
6 fuzzutil.o: fuzzutil.cc fuzzutil.h
7 $(CXX) $(CXXFLAGS) -g -O1 -fsanitize=fuzzer-no-link,address \
7 $(CXX) $(CXXFLAGS) -g -O1 -fsanitize=fuzzer-no-link,address \
8 -std=c++17 \
8 -std=c++17 \
9 -I../../mercurial -c -o fuzzutil.o fuzzutil.cc
9 -I../../mercurial -c -o fuzzutil.o fuzzutil.cc
10
10
11 fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h
11 fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h
12 $(CXX) $(CXXFLAGS) -std=c++17 \
12 $(CXX) $(CXXFLAGS) -std=c++17 \
13 -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc
13 -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc
14
14
15 bdiff.o: ../../mercurial/bdiff.c
15 bdiff.o: ../../mercurial/bdiff.c
16 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
16 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
17 ../../mercurial/bdiff.c
17 ../../mercurial/bdiff.c
18
18
19 bdiff: bdiff.cc bdiff.o fuzzutil.o
19 bdiff: bdiff.cc bdiff.o fuzzutil.o
20 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
20 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
21 -std=c++17 \
21 -std=c++17 \
22 -I../../mercurial bdiff.cc bdiff.o fuzzutil.o -o bdiff
22 -I../../mercurial bdiff.cc bdiff.o fuzzutil.o -o bdiff
23
23
24 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
24 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
25 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
25 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
26
26
27 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o
27 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o
28 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
28 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
29 bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \
29 bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \
30 $$OUT/bdiff_fuzzer
30 $$OUT/bdiff_fuzzer
31
31
32 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
32 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
33 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \
33 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \
34 -o $@ \
34 -o $@ \
35 $<
35 $<
36
36
37 xdiff: CXXFLAGS += -std=c++17
37 xdiff: CXXFLAGS += -std=c++17
38 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o
38 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o
39 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
39 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
40 -I../../mercurial xdiff.cc \
40 -I../../mercurial xdiff.cc \
41 xdiffi.o xprepare.o xutils.o fuzzutil.o -o xdiff
41 xdiffi.o xprepare.o xutils.o fuzzutil.o -o xdiff
42
42
43 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
43 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
44 $(CC) $(CFLAGS) -c \
44 $(CC) $(CFLAGS) -c \
45 -o $@ \
45 -o $@ \
46 $<
46 $<
47
47
48 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o
48 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o
49 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
49 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
50 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o \
50 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o \
51 -lFuzzingEngine -o $$OUT/xdiff_fuzzer
51 -lFuzzingEngine -o $$OUT/xdiff_fuzzer
52
52
53 clean:
53 clean:
54 rm *.o *_fuzzer \
54 $(RM) *.o *_fuzzer \
55 bdiff \
55 bdiff \
56 xdiff
56 xdiff
57
57
58 oss-fuzz: bdiff_fuzzer xdiff_fuzzer
58 oss-fuzz: bdiff_fuzzer xdiff_fuzzer
59
59
60 .PHONY: all clean oss-fuzz
60 .PHONY: all clean oss-fuzz
General Comments 0
You need to be logged in to leave comments. Login now