2020-10-14 01:48:00 +02:00
|
|
|
# This Makefile will compile all fuzzing targets. It doesn't check tool
|
|
|
|
# requirements and paths may need to be updated depending on your environment.
|
|
|
|
# Note a clang 6+ toolchain is assumed for use of -fsanitize=fuzzer.
|
|
|
|
|
|
|
|
CC = clang
|
|
|
|
CXX = clang++
|
2020-10-17 19:46:59 +02:00
|
|
|
CFLAGS = -fsanitize=fuzzer -I../../src -I../.. -Wall -Wextra
|
2020-10-14 01:48:00 +02:00
|
|
|
CXXFLAGS = $(CFLAGS)
|
|
|
|
LDFLAGS = -fsanitize=fuzzer
|
|
|
|
LDLIBS = ../../src/mux/libwebpmux.a ../../src/demux/libwebpdemux.a
|
2020-10-15 04:39:02 +02:00
|
|
|
LDLIBS += ../../src/libwebp.a ../../imageio/libimageio_util.a
|
2022-08-04 17:56:59 +02:00
|
|
|
LDLIBS += ../../sharpyuv/libsharpyuv.a
|
2020-10-14 01:48:00 +02:00
|
|
|
|
2023-09-12 23:11:37 +02:00
|
|
|
FUZZERS = advanced_api_fuzzer animation_api_fuzzer animdecoder_fuzzer
|
|
|
|
FUZZERS += animencoder_fuzzer enc_dec_fuzzer huffman_fuzzer
|
|
|
|
FUZZERS += mux_demux_api_fuzzer simple_api_fuzzer
|
2020-10-14 01:48:00 +02:00
|
|
|
|
2020-10-17 19:46:59 +02:00
|
|
|
%.o: fuzz_utils.h img_alpha.h img_grid.h img_peak.h
|
2020-10-14 01:48:00 +02:00
|
|
|
all: $(FUZZERS)
|
|
|
|
|
|
|
|
define FUZZER_template
|
|
|
|
$(1): $$(addsuffix .o, $(1)) $(LDLIBS)
|
|
|
|
OBJS += $$(addsuffix .o, $(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach fuzzer, $(FUZZERS), $(eval $(call FUZZER_template, $(fuzzer))))
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(FUZZERS) $(OBJS)
|
|
|
|
|
|
|
|
.PHONY: all clean
|