vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
Makefile
(1709B)
1 -include ../../config.mk
2
3 ALL = text-fuzzer text-libfuzzer buffer-fuzzer
4 CC = afl-gcc
5 CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4
6
7 TEXT_SRC = ../../text.c ../../text-common.c ../../text-io.c ../../text-iterator.c ../../text-util.c ../../text-motions.c ../../text-objects.c ../../text-regex.c ../../array.c
8
9 test: $(ALL)
10
11 text-fuzzer: text-fuzzer.c fuzzer.h $(TEXT_SRC)
12 @echo Compiling $@ binary
13 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@
14
15 text-libfuzzer: text-fuzzer.c fuzzer.h $(TEXT_SRC)
16 @echo Compiling $@ binary
17 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} -DLIBFUZZER ${filter %.c, $^} -fsanitize=fuzzer,address,undefined ${LDFLAGS} -o $@
18
19 buffer-fuzzer: buffer-fuzzer.c fuzzer.h ../../buffer.c
20 @echo Compiling $@ binary
21 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@
22
23 debug: clean
24 $(MAKE) CFLAGS_EXTRA='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}'
25
26 afl-fuzz-text: text-fuzzer
27 @mkdir -p "results/$<"
28 @afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \
29 afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<"
30
31 libfuzzer-text: text-libfuzzer
32 @mkdir -p "results/$<"
33 @./$< -close_fd_mask=1 -only_ascii=1 -print_final_stats=1 "-dict=dictionaries/$<.dict" "inputs/$<" "results/$<"
34
35 afl-fuzz-buffer: buffer-fuzzer
36 @mkdir -p "results/$<"
37 @afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \
38 afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<"
39
40 clean:
41 @echo cleaning
42 @rm -f $(ALL)
43
44 distclean: clean
45 @rm -rf results/
46
47 .PHONY: clean distclean debug afl-fuzz-text libfuzzer-text afl-fuzz-buffer