summaryrefslogtreecommitdiffstats
path: root/fuzz/Makefile.am
blob: da6c8ae62d5bfc35a1dffa495c67f544b3d125dd (plain)
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
if BUILD_FUZZERS

libFuzzer.a: Fuzzer/build.sh
	@echo "Building $@"
	@./Fuzzer/build.sh

Fuzzer/build.sh: LIBFUZZER_SRC

LIBFUZZER_SRC:
	@if test -d Fuzzer ; then \
		if test -d Fuzzer/.git ; then \
			echo Making sure libFuzzer source tree is up-to-date... ; \
			cd Fuzzer && git checkout . && git pull && cd .. ; \
		fi \
	else \
		echo Checking out libFuzzer source code... ; \
		git clone https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer ; \
	fi

CLEANFILES = libFuzzer.a

noinst_PROGRAMS = \
	xplist_fuzzer \
	bplist_fuzzer \
	jplist_fuzzer

xplist_fuzzer_SOURCES = xplist_fuzzer.cc
xplist_fuzzer_LDFLAGS = -static
xplist_fuzzer_LDADD = $(top_builddir)/src/libplist-2.0.la libFuzzer.a

bplist_fuzzer_SOURCES = bplist_fuzzer.cc
bplist_fuzzer_LDFLAGS = -static
bplist_fuzzer_LDADD = $(top_builddir)/src/libplist-2.0.la libFuzzer.a

jplist_fuzzer_SOURCES = jplist_fuzzer.cc
jplist_fuzzer_LDFLAGS = -static
jplist_fuzzer_LDADD = $(top_builddir)/src/libplist-2.0.la libFuzzer.a

TESTS = fuzzers.test

EXTRA_DIST = \
	bplist.dict \
	xplist.dict \
	jplist.dict \
	init-fuzzers.sh \
	test-fuzzers.sh \
	fuzzers.test

endif