File: Makefile

package info (click to toggle)
vis 0.5%2Bts-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,416 kB
  • sloc: ansic: 21,794; sh: 905; makefile: 314; python: 45
file content (37 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download
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
-include ../../config.mk

ALL = text-fuzzer buffer-fuzzer
CC = afl-gcc
CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4

test: $(ALL)

text-fuzzer: text-fuzzer.c fuzzer.h ../../text.c ../../text-util.c ../../text-motions.c ../../text-objects.c ../../text-regex.c
	@echo Compiling $@ binary
	${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@

buffer-fuzzer: buffer-fuzzer.c fuzzer.h ../../buffer.c
	@echo Compiling $@ binary
	@${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@

debug: clean
	$(MAKE) CFLAGS_EXTRA='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}'

afl-fuzz-text: text-fuzzer
	@mkdir -p "results/$<"
	@afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \
	 afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<"

afl-fuzz-buffer: buffer-fuzzer
	@mkdir -p "results/$<"
	@afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \
	 afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<"

clean:
	@echo cleaning
	@rm -f $(ALL)

distclean: clean
	@rm -rf results/

.PHONY: clean distclean debug afl-fuzz-text afl-fuzz-buffer