| 1 |
# This Makefile will compile all fuzzing targets. It doesn't check tool |
| 2 |
# requirements and paths may need to be updated depending on your environment. |
| 3 |
# Note a clang 6+ toolchain is assumed for use of -fsanitize=fuzzer. |
| 4 |
|
| 5 |
CC = clang |
| 6 |
CXX = clang++ |
| 7 |
CFLAGS = -fsanitize=fuzzer -I../../src -I../.. -Wall -Wextra |
| 8 |
CXXFLAGS = $(CFLAGS) |
| 9 |
LDFLAGS = -fsanitize=fuzzer |
| 10 |
LDLIBS = ../../src/mux/libwebpmux.a ../../src/demux/libwebpdemux.a |
| 11 |
LDLIBS += ../../src/libwebp.a ../../imageio/libimageio_util.a |
| 12 |
LDLIBS += ../../sharpyuv/libsharpyuv.a |
| 13 |
|
| 14 |
FUZZERS = advanced_api_fuzzer animation_api_fuzzer animdecoder_fuzzer |
| 15 |
FUZZERS += animencoder_fuzzer enc_dec_fuzzer huffman_fuzzer |
| 16 |
FUZZERS += mux_demux_api_fuzzer simple_api_fuzzer |
| 17 |
|
| 18 |
%.o: fuzz_utils.h img_alpha.h img_grid.h img_peak.h |
| 19 |
all: $(FUZZERS) |
| 20 |
|
| 21 |
define FUZZER_template |
| 22 |
$(1): $$(addsuffix .o, $(1)) $(LDLIBS) |
| 23 |
OBJS += $$(addsuffix .o, $(1)) |
| 24 |
endef |
| 25 |
|
| 26 |
$(foreach fuzzer, $(FUZZERS), $(eval $(call FUZZER_template, $(fuzzer)))) |
| 27 |
|
| 28 |
clean: |
| 29 |
$(RM) $(FUZZERS) $(OBJS) |
| 30 |
|
| 31 |
.PHONY: all clean |