Show More
@@ -1,177 +1,179 | |||
|
1 | 1 | CC = clang |
|
2 | 2 | CXX = clang++ |
|
3 | 3 | |
|
4 | 4 | LIB_FUZZING_ENGINE ?= -lFuzzingEngine |
|
5 | 5 | |
|
6 | CXXFLAGS += -Wno-deprecated-register | |
|
7 | ||
|
6 | 8 | all: bdiff mpatch xdiff |
|
7 | 9 | |
|
8 | 10 | pyutil.o: pyutil.cc pyutil.h |
|
9 | 11 | $(CXX) $(CXXFLAGS) -g -O1 \ |
|
10 | 12 | `$$OUT/sanpy/bin/python-config --cflags` \ |
|
11 | 13 | -I../../mercurial -c -o pyutil.o pyutil.cc |
|
12 | 14 | |
|
13 | 15 | bdiff.o: ../../mercurial/bdiff.c |
|
14 | 16 | $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ |
|
15 | 17 | ../../mercurial/bdiff.c |
|
16 | 18 | |
|
17 | 19 | bdiff: bdiff.cc bdiff.o |
|
18 | 20 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
19 | 21 | -std=c++17 \ |
|
20 | 22 | -I../../mercurial bdiff.cc bdiff.o -o bdiff |
|
21 | 23 | |
|
22 | 24 | bdiff-oss-fuzz.o: ../../mercurial/bdiff.c |
|
23 | 25 | $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c |
|
24 | 26 | |
|
25 | 27 | bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o |
|
26 | 28 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ |
|
27 | 29 | bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ |
|
28 | 30 | $$OUT/bdiff_fuzzer |
|
29 | 31 | |
|
30 | 32 | mpatch.o: ../../mercurial/mpatch.c |
|
31 | 33 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ |
|
32 | 34 | ../../mercurial/mpatch.c |
|
33 | 35 | |
|
34 | 36 | mpatch: CXXFLAGS += -std=c++17 |
|
35 | 37 | mpatch: mpatch.cc mpatch.o |
|
36 | 38 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
37 | 39 | -I../../mercurial mpatch.cc mpatch.o -o mpatch |
|
38 | 40 | |
|
39 | 41 | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c |
|
40 | 42 | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c |
|
41 | 43 | |
|
42 | 44 | mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o |
|
43 | 45 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ |
|
44 | 46 | mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ |
|
45 | 47 | $$OUT/mpatch_fuzzer |
|
46 | 48 | |
|
47 | 49 | mpatch_corpus.zip: |
|
48 | 50 | python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip |
|
49 | 51 | |
|
50 | 52 | x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
|
51 | 53 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ |
|
52 | 54 | -o $@ \ |
|
53 | 55 | $< |
|
54 | 56 | |
|
55 | 57 | xdiff: CXXFLAGS += -std=c++17 |
|
56 | 58 | xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o |
|
57 | 59 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
58 | 60 | -I../../mercurial xdiff.cc \ |
|
59 | 61 | xdiffi.o xprepare.o xutils.o -o xdiff |
|
60 | 62 | |
|
61 | 63 | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
|
62 | 64 | $(CC) $(CFLAGS) -c \ |
|
63 | 65 | -o $@ \ |
|
64 | 66 | $< |
|
65 | 67 | |
|
66 | 68 | xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o |
|
67 | 69 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ |
|
68 | 70 | fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \ |
|
69 | 71 | $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer |
|
70 | 72 | |
|
71 | 73 | manifest.o: ../../mercurial/cext/manifest.c |
|
72 | 74 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
73 | 75 | -I../../mercurial \ |
|
74 | 76 | -c -o manifest.o ../../mercurial/cext/manifest.c |
|
75 | 77 | |
|
76 | 78 | charencode.o: ../../mercurial/cext/charencode.c |
|
77 | 79 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
78 | 80 | -I../../mercurial \ |
|
79 | 81 | -c -o charencode.o ../../mercurial/cext/charencode.c |
|
80 | 82 | |
|
81 | 83 | parsers.o: ../../mercurial/cext/parsers.c |
|
82 | 84 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
83 | 85 | -I../../mercurial \ |
|
84 | 86 | -c -o parsers.o ../../mercurial/cext/parsers.c |
|
85 | 87 | |
|
86 | 88 | dirs.o: ../../mercurial/cext/dirs.c |
|
87 | 89 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
88 | 90 | -I../../mercurial \ |
|
89 | 91 | -c -o dirs.o ../../mercurial/cext/dirs.c |
|
90 | 92 | |
|
91 | 93 | pathencode.o: ../../mercurial/cext/pathencode.c |
|
92 | 94 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
93 | 95 | -I../../mercurial \ |
|
94 | 96 | -c -o pathencode.o ../../mercurial/cext/pathencode.c |
|
95 | 97 | |
|
96 | 98 | revlog.o: ../../mercurial/cext/revlog.c |
|
97 | 99 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
98 | 100 | -I../../mercurial \ |
|
99 | 101 | -c -o revlog.o ../../mercurial/cext/revlog.c |
|
100 | 102 | |
|
101 | 103 | dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
102 | 104 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
103 | 105 | -Wno-register -Wno-macro-redefined \ |
|
104 | 106 | -I../../mercurial dirs.cc \ |
|
105 | 107 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
106 | 108 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
107 | 109 | -o $$OUT/dirs_fuzzer |
|
108 | 110 | |
|
109 | 111 | fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
110 | 112 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
111 | 113 | -Wno-register -Wno-macro-redefined \ |
|
112 | 114 | -I../../mercurial fncache.cc \ |
|
113 | 115 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
114 | 116 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
115 | 117 | -o $$OUT/fncache_fuzzer |
|
116 | 118 | |
|
117 | 119 | jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
118 | 120 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
119 | 121 | -Wno-register -Wno-macro-redefined \ |
|
120 | 122 | -I../../mercurial jsonescapeu8fast.cc \ |
|
121 | 123 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
122 | 124 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
123 | 125 | -o $$OUT/jsonescapeu8fast_fuzzer |
|
124 | 126 | |
|
125 | 127 | manifest_corpus.zip: |
|
126 | 128 | python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip |
|
127 | 129 | |
|
128 | 130 | manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
129 | 131 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
130 | 132 | -Wno-register -Wno-macro-redefined \ |
|
131 | 133 | -I../../mercurial manifest.cc \ |
|
132 | 134 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
133 | 135 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
134 | 136 | -o $$OUT/manifest_fuzzer |
|
135 | 137 | |
|
136 | 138 | revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
137 | 139 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
138 | 140 | -Wno-register -Wno-macro-redefined \ |
|
139 | 141 | -I../../mercurial revlog.cc \ |
|
140 | 142 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
141 | 143 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
142 | 144 | -o $$OUT/revlog_fuzzer |
|
143 | 145 | |
|
144 | 146 | revlog_corpus.zip: |
|
145 | 147 | python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip |
|
146 | 148 | |
|
147 | 149 | dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
148 | 150 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
149 | 151 | -Wno-register -Wno-macro-redefined \ |
|
150 | 152 | -I../../mercurial dirstate.cc \ |
|
151 | 153 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
152 | 154 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
153 | 155 | -o $$OUT/dirstate_fuzzer |
|
154 | 156 | |
|
155 | 157 | dirstate_corpus.zip: |
|
156 | 158 | python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip |
|
157 | 159 | |
|
158 | 160 | fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
159 | 161 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
160 | 162 | -Wno-register -Wno-macro-redefined \ |
|
161 | 163 | -I../../mercurial fm1readmarkers.cc \ |
|
162 | 164 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
163 | 165 | $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
164 | 166 | -o $$OUT/fm1readmarkers_fuzzer |
|
165 | 167 | |
|
166 | 168 | fm1readmarkers_corpus.zip: |
|
167 | 169 | python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip |
|
168 | 170 | |
|
169 | 171 | clean: |
|
170 | 172 | $(RM) *.o *_fuzzer \ |
|
171 | 173 | bdiff \ |
|
172 | 174 | mpatch \ |
|
173 | 175 | xdiff |
|
174 | 176 | |
|
175 | 177 | oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip |
|
176 | 178 | |
|
177 | 179 | .PHONY: all clean oss-fuzz |
General Comments 0
You need to be logged in to leave comments.
Login now