Show More
@@ -18,6 +18,9 b' all: standalone_fuzz_target_runner.o oss' | |||||
18 |
|
18 | |||
19 | standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cc |
|
19 | standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cc | |
20 |
|
20 | |||
|
21 | $$OUT/%_fuzzer_seed_corpus.zip: %_corpus.py | |||
|
22 | python $< $@ | |||
|
23 | ||||
21 | pyutil.o: pyutil.cc pyutil.h |
|
24 | pyutil.o: pyutil.cc pyutil.h | |
22 | $(CXX) $(CXXFLAGS) -g -O1 \ |
|
25 | $(CXX) $(CXXFLAGS) -g -O1 \ | |
23 | `$(PYTHON_CONFIG) --cflags` \ |
|
26 | `$(PYTHON_CONFIG) --cflags` \ | |
@@ -38,14 +41,11 b' mpatch.o: ../../mercurial/mpatch.c' | |||||
38 | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c |
|
41 | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c | |
39 | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c |
|
42 | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c | |
40 |
|
43 | |||
41 | mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o |
|
44 | mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o $$OUT/mpatch_fuzzer_seed_corpus.zip | |
42 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ |
|
45 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ | |
43 | mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ |
|
46 | mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ | |
44 | $$OUT/mpatch_fuzzer |
|
47 | $$OUT/mpatch_fuzzer | |
45 |
|
48 | |||
46 | mpatch_corpus.zip: |
|
|||
47 | python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip |
|
|||
48 |
|
||||
49 | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
|
49 | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | |
50 | $(CC) $(CFLAGS) -c \ |
|
50 | $(CC) $(CFLAGS) -c \ | |
51 | -o $@ \ |
|
51 | -o $@ \ | |
@@ -86,10 +86,7 b' jsonescapeu8fast_fuzzer: jsonescapeu8fas' | |||||
86 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
|
86 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ | |
87 | -o $$OUT/jsonescapeu8fast_fuzzer |
|
87 | -o $$OUT/jsonescapeu8fast_fuzzer | |
88 |
|
88 | |||
89 | manifest_corpus.zip: |
|
89 | manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS) $$OUT/manifest_fuzzer_seed_corpus.zip | |
90 | python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip |
|
|||
91 |
|
||||
92 | manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS) |
|
|||
93 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
|
90 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ | |
94 | -Wno-register -Wno-macro-redefined \ |
|
91 | -Wno-register -Wno-macro-redefined \ | |
95 | -I../../mercurial manifest.cc \ |
|
92 | -I../../mercurial manifest.cc \ | |
@@ -97,7 +94,7 b' manifest_fuzzer: manifest.cc pyutil.o $(' | |||||
97 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
|
94 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ | |
98 | -o $$OUT/manifest_fuzzer |
|
95 | -o $$OUT/manifest_fuzzer | |
99 |
|
96 | |||
100 | revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS) |
|
97 | revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS) $$OUT/revlog_fuzzer_seed_corpus.zip | |
101 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
|
98 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ | |
102 | -Wno-register -Wno-macro-redefined \ |
|
99 | -Wno-register -Wno-macro-redefined \ | |
103 | -I../../mercurial revlog.cc \ |
|
100 | -I../../mercurial revlog.cc \ | |
@@ -105,10 +102,7 b' revlog_fuzzer: revlog.cc pyutil.o $(PARS' | |||||
105 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
|
102 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ | |
106 | -o $$OUT/revlog_fuzzer |
|
103 | -o $$OUT/revlog_fuzzer | |
107 |
|
104 | |||
108 | revlog_corpus.zip: |
|
105 | dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirstate_fuzzer_seed_corpus.zip | |
109 | python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip |
|
|||
110 |
|
||||
111 | dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS) |
|
|||
112 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
|
106 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ | |
113 | -Wno-register -Wno-macro-redefined \ |
|
107 | -Wno-register -Wno-macro-redefined \ | |
114 | -I../../mercurial dirstate.cc \ |
|
108 | -I../../mercurial dirstate.cc \ | |
@@ -116,10 +110,7 b' dirstate_fuzzer: dirstate.cc pyutil.o $(' | |||||
116 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
|
110 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ | |
117 | -o $$OUT/dirstate_fuzzer |
|
111 | -o $$OUT/dirstate_fuzzer | |
118 |
|
112 | |||
119 | dirstate_corpus.zip: |
|
113 | fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS) $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip | |
120 | python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip |
|
|||
121 |
|
||||
122 | fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS) |
|
|||
123 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
|
114 | $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ | |
124 | -Wno-register -Wno-macro-redefined \ |
|
115 | -Wno-register -Wno-macro-redefined \ | |
125 | -I../../mercurial fm1readmarkers.cc \ |
|
116 | -I../../mercurial fm1readmarkers.cc \ | |
@@ -127,15 +118,12 b' fm1readmarkers_fuzzer: fm1readmarkers.cc' | |||||
127 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
|
118 | $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ | |
128 | -o $$OUT/fm1readmarkers_fuzzer |
|
119 | -o $$OUT/fm1readmarkers_fuzzer | |
129 |
|
120 | |||
130 | fm1readmarkers_corpus.zip: |
|
|||
131 | python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip |
|
|||
132 |
|
||||
133 | clean: |
|
121 | clean: | |
134 | $(RM) *.o *_fuzzer \ |
|
122 | $(RM) *.o *_fuzzer \ | |
135 | bdiff \ |
|
123 | bdiff \ | |
136 | mpatch \ |
|
124 | mpatch \ | |
137 | xdiff |
|
125 | xdiff | |
138 |
|
126 | |||
139 |
oss-fuzz: bdiff_fuzzer mpatch_fuzzer |
|
127 | oss-fuzz: bdiff_fuzzer mpatch_fuzzer xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer revlog_fuzzer dirstate_fuzzer fm1readmarkers_fuzzer | |
140 |
|
128 | |||
141 | .PHONY: all clean oss-fuzz |
|
129 | .PHONY: all clean oss-fuzz |
General Comments 0
You need to be logged in to leave comments.
Login now