aboutsummaryrefslogtreecommitdiff
path: root/fuzz/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/Makefile')
-rw-r--r--fuzz/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/fuzz/Makefile b/fuzz/Makefile
index 66037a2..bb05bd6 100644
--- a/fuzz/Makefile
+++ b/fuzz/Makefile
@@ -1,6 +1,6 @@
-include ../../config.mk
-ALL = text-fuzzer
+ALL = text-fuzzer buffer-fuzzer
CC = afl-gcc
CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4
@@ -10,6 +10,10 @@ text-fuzzer: text-fuzzer.c fuzzer.h ../../text.c ../../text-util.c ../../text-mo
@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}'
@@ -18,6 +22,11 @@ afl-fuzz-text: text-fuzzer
@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)
@@ -25,4 +34,4 @@ clean:
distclean: clean
@rm -rf results/
-.PHONY: clean distclean debug afl-fuzz-text
+.PHONY: clean distclean debug afl-fuzz-text afl-fuzz-buffer