summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-02-07 18:12:01 -0800
committerBen Smith <binji@chromium.org>2016-02-14 15:37:13 -0800
commit115d44b85d88cc7cd8d43c177da6c95376317979 (patch)
tree6ad76f5086b0d9863a5f9d6aab77ed171c175562 /Makefile
parent264b120b18c05af8fa4fab1bc3668ff7bf6de471 (diff)
downloadwabt-115d44b85d88cc7cd8d43c177da6c95376317979.tar.gz
wabt-115d44b85d88cc7cd8d43c177da6c95376317979.tar.bz2
wabt-115d44b85d88cc7cd8d43c177da6c95376317979.zip
[fuzz] add fuzz build, and gcc fixes so it builds
Looks like gcc is a little more strict about potentially unused variables.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 68cfe284..04813ae9 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,9 @@ CFLAGS = -Wall -Werror -g -Wno-unused-function -Wno-return-type
DEPEND_FLAGS = -MMD -MP -MF $(patsubst %.o,%.d,$@)
LIBS =
+AFL_DIR ?= ~/dev/afl/afl-1.83b
+AFL_CC := $(AFL_DIR)/afl-gcc
+
SEXPR_WASM_CC := $(CC)
SEXPR_WASM_CFLAGS := $(CFLAGS)
SEXPR_WASM_SRCS := \
@@ -46,6 +49,11 @@ SEXPR_WASM_LSAN_CFLAGS := $(LSAN_FLAGS) $(CFLAGS)
SEXPR_WASM_LSAN_LDFLAGS := $(LSAN_FLAGS)
SEXPR_WASM_LSAN_SRCS := $(SEXPR_WASM_SRCS)
+SEXPR_WASM_FUZZ_CC := $(AFL_CC)
+SEXPR_WASM_FUZZ_CFLAGS := -O3 $(CFLAGS)
+SEXPR_WASM_FUZZ_LDFLAGS :=
+SEXPR_WASM_FUZZ_SRCS := $(SEXPR_WASM_SRCS)
+
.PHONY: all
all: $(addprefix out/,$(ALL))
@@ -80,6 +88,7 @@ $(eval $(call EXE,sexpr-wasm,SEXPR_WASM))
$(eval $(call EXE,sexpr-wasm-asan,SEXPR_WASM_ASAN))
$(eval $(call EXE,sexpr-wasm-msan,SEXPR_WASM_MSAN))
$(eval $(call EXE,sexpr-wasm-lsan,SEXPR_WASM_LSAN))
+$(eval $(call EXE,sexpr-wasm-fuzz,SEXPR_WASM_FUZZ))
#### TESTS ####
.PHONY: test
@@ -101,6 +110,15 @@ test-lsan: out/sexpr-wasm-lsan
.PHONY: test-everything
test-everything: test test-asan test-msan test-lsan
+#### FUZZ ####
+
+FUZZ_IN = fuzz-in
+FUZZ_OUT = fuzz-out
+
+.PHONY: fuzz
+fuzz: out/sexpr-wasm-fuzz
+ $(AFL_DIR)/afl-fuzz -i $(FUZZ_IN) -o $(FUZZ_OUT) -x wasm.dict -- $^ @@
+
#### CLEAN ####
.PHONY: clean
clean: