-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (72 loc) · 2.14 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
TARGET = sapi/fuzzer/php-fuzz-unserialize
ORIGINAL_REPO = original
SAFE_TARGET = safe/$(TARGET)
BACKDOORED_TARGET = backdoored/$(TARGET)
GROUND_TRUTH_TARGET = ground-truth/$(TARGET)
all: original safe backdoored ground-truth
safe: $(SAFE_TARGET)
backdoored: $(BACKDOORED_TARGET)
ground-truth: $(GROUND_TRUTH_TARGET)
$(SAFE_TARGET): $(ORIGINAL_REPO)
rm -rf safe/
cp -r $(ORIGINAL_REPO) safe/
cd safe/ && \
patch -p1 < ../patches/base.patch && \
./buildconf --force && \
LIB_FUZZING_ENGINE="-Wall" ./configure \
--disable-all \
--enable-option-checking=fatal \
--enable-fuzzer \
--enable-exif \
--enable-phar \
--without-pcre-jit \
--disable-phpdbg \
--disable-cgi \
--with-pic && \
$(MAKE) -j$(shell nproc) clean && \
$(MAKE) -j$(shell nproc) EXTRA_CXXFLAGS=$(EXTRA_CXXFLAGS)
$(BACKDOORED_TARGET): $(ORIGINAL_REPO) patches/backdoored.patch
rm -rf backdoored/
cp -r $(ORIGINAL_REPO) backdoored/
cd backdoored/ && \
patch -p1 < ../patches/base.patch && \
patch -p1 < ../patches/backdoored.patch && \
./buildconf --force && \
LIB_FUZZING_ENGINE="-Wall" ./configure \
--disable-all \
--enable-option-checking=fatal \
--enable-fuzzer \
--enable-exif \
--enable-phar \
--without-pcre-jit \
--disable-phpdbg \
--disable-cgi \
--with-pic && \
$(MAKE) -j$(shell nproc) clean && \
$(MAKE) -j$(shell nproc) EXTRA_CXXFLAGS=$(EXTRA_CXXFLAGS)
$(GROUND_TRUTH_TARGET): $(ORIGINAL_REPO) patches/ground-truth.patch
rm -rf ground-truth/
cp -r $(ORIGINAL_REPO) ground-truth/
cd ground-truth/ && \
patch -p1 < ../patches/base.patch && \
patch -p1 < ../patches/ground-truth.patch && \
./buildconf --force && \
LIB_FUZZING_ENGINE="-Wall" ./configure \
--disable-all \
--enable-option-checking=fatal \
--enable-fuzzer \
--enable-exif \
--enable-phar \
--without-pcre-jit \
--disable-phpdbg \
--disable-cgi \
--with-pic && \
$(MAKE) -j$(shell nproc) clean && \
$(MAKE) -j$(shell nproc) EXTRA_CXXFLAGS=$(EXTRA_CXXFLAGS)
clean:
rm -rf safe/ backdoored/ ground-truth/
setup:
# No-op.
teardown:
# No-op.
.PHONY: clean all safe backdoored ground-truth setup teardown