makefile.unix 1002 B

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