mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
443db47d91
Bug: webp:409 Change-Id: Iade1e6b1288faad9076f72c21c1bde5a6bbfc7e0
30 lines
928 B
Plaintext
30 lines
928 B
Plaintext
# 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++
|
|
CFLAGS = -fsanitize=fuzzer -I../../src -I../..
|
|
CXXFLAGS = $(CFLAGS)
|
|
LDFLAGS = -fsanitize=fuzzer
|
|
LDLIBS = ../../src/mux/libwebpmux.a ../../src/demux/libwebpdemux.a
|
|
LDLIBS += ../../src/libwebp.a ../../imageio/libimageio_util.a
|
|
|
|
FUZZERS = advanced_api_fuzzer animation_api_fuzzer animencoder_fuzzer
|
|
FUZZERS += animdecoder_fuzzer demux_api_fuzzer enc_dec_fuzzer simple_api_fuzzer
|
|
|
|
%.o: %.c %.cc fuzz_utils.h img_alpha.h img_grid.h img_peak.h
|
|
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
|