Makefile.am 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. AM_CPPFLAGS = @CPPFLAGS@ \
  2. @FUZZING_CFLAGS@ \
  3. -I$(top_srcdir)/src/libstrongswan \
  4. -I$(top_srcdir)/src/libimcv \
  5. -I$(top_srcdir)/src/libtncif \
  6. -I$(top_srcdir)/src/libtpmtss \
  7. -I$(top_srcdir)/src/libtnccs \
  8. -I$(top_srcdir)/src/libtnccs/plugins/tnccs_20 \
  9. -DPLUGINDIR=\""$(abs_top_builddir)/src/libstrongswan/plugins\"" \
  10. -DPLUGINS="\"${fuzz_plugins}\""
  11. fuzz_ldflags = ${libfuzzer} \
  12. $(top_builddir)/src/libstrongswan/.libs/libstrongswan.a \
  13. -Wl,-Bstatic -lgmp -Wl,-Bdynamic \
  14. @FUZZING_LDFLAGS@
  15. pa_tnc_ldflags = \
  16. $(top_builddir)/src/libimcv/.libs/libimcv.a \
  17. $(top_builddir)/src/libtncif/.libs/libtncif.a \
  18. $(top_builddir)/src/libtpmtss/.libs/libtpmtss.a \
  19. $(fuzz_ldflags)
  20. pb_tnc_ldflags = \
  21. $(top_builddir)/src/libtnccs/.libs/libtnccs.a \
  22. $(top_builddir)/src/libtncif/.libs/libtncif.a \
  23. $(fuzz_ldflags)
  24. FUZZ_TARGETS=fuzz_certs fuzz_crls fuzz_pa_tnc fuzz_pb_tnc
  25. all-local: $(FUZZ_TARGETS)
  26. CLEANFILES=$(FUZZ_TARGETS)
  27. fuzz_certs: fuzz_certs.c ${libfuzzer}
  28. $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(fuzz_ldflags)
  29. fuzz_crls: fuzz_crls.c ${libfuzzer}
  30. $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(fuzz_ldflags)
  31. fuzz_pa_tnc: fuzz_pa_tnc.c ${libfuzzer}
  32. $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(pa_tnc_ldflags)
  33. fuzz_pb_tnc: fuzz_pb_tnc.c ${libfuzzer}
  34. $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(pb_tnc_ldflags)
  35. noinst_LIBRARIES = libFuzzerLocal.a
  36. libFuzzerLocal_a_SOURCES = libFuzzerLocal.c
  37. libFuzzerLocal_a_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
  38. check: all
  39. for f in $(FUZZ_TARGETS); do \
  40. corpus=$${f#fuzz_}; \
  41. ./$$f $(FUZZING_CORPORA)/$${corpus}/*; \
  42. crashes=$(FUZZING_CORPORA)/$${corpus}-crash; \
  43. test ! -d $${crashes} || ./$$f $${crashes}/*; \
  44. done