xref: /aosp_15_r20/external/webp/tests/fuzzer/makefile.unix (revision b2055c353e87c8814eb2b6b1b11112a1562253bd)
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
5CC = clang
6CXX = clang++
7CFLAGS = -fsanitize=fuzzer -I../../src -I../.. -Wall -Wextra
8CXXFLAGS = $(CFLAGS)
9LDFLAGS = -fsanitize=fuzzer
10LDLIBS = ../../src/mux/libwebpmux.a ../../src/demux/libwebpdemux.a
11LDLIBS += ../../src/libwebp.a ../../imageio/libimageio_util.a
12LDLIBS += ../../sharpyuv/libsharpyuv.a
13
14FUZZERS = advanced_api_fuzzer animation_api_fuzzer animdecoder_fuzzer
15FUZZERS += animencoder_fuzzer enc_dec_fuzzer huffman_fuzzer
16FUZZERS += mux_demux_api_fuzzer simple_api_fuzzer
17
18%.o: fuzz_utils.h img_alpha.h img_grid.h img_peak.h
19all: $(FUZZERS)
20
21define FUZZER_template
22$(1): $$(addsuffix .o, $(1)) $(LDLIBS)
23OBJS += $$(addsuffix .o, $(1))
24endef
25
26$(foreach fuzzer, $(FUZZERS), $(eval $(call FUZZER_template, $(fuzzer))))
27
28clean:
29	$(RM) $(FUZZERS) $(OBJS)
30
31.PHONY: all clean
32