2017-06-09 16:27:37 +02:00
|
|
|
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) -Wno-unused-parameter
|
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(srcdir) -DSRCDIR=\"$(abs_srcdir)\" -DTEST_RUN
|
2017-06-16 16:51:33 +02:00
|
|
|
#AM_LDFLAGS = -static
|
|
|
|
AM_LDFLAGS = -no-install
|
|
|
|
LDADD = ../src/libpsl.la $(LIBICU_LIBS) $(LIBIDN_LIBS) $(LIBIDN2_LIBS)
|
2017-06-09 16:27:37 +02:00
|
|
|
|
|
|
|
PSL_TESTS = \
|
|
|
|
libpsl_fuzzer$(EXEEXT) \
|
2017-06-14 09:49:07 +02:00
|
|
|
libpsl_load_fuzzer$(EXEEXT) \
|
2017-06-09 16:27:37 +02:00
|
|
|
libpsl_load_dafsa_fuzzer$(EXEEXT)
|
|
|
|
|
|
|
|
check_PROGRAMS = $(PSL_TESTS)
|
|
|
|
|
|
|
|
libpsl_fuzzer_SOURCES = libpsl_fuzzer.c main.c fuzzer.h
|
2017-06-14 09:49:07 +02:00
|
|
|
libpsl_load_fuzzer_SOURCES = libpsl_load_fuzzer.c main.c fuzzer.h
|
2017-06-09 16:27:37 +02:00
|
|
|
libpsl_load_dafsa_fuzzer_SOURCES = libpsl_load_dafsa_fuzzer.c main.c fuzzer.h
|
|
|
|
|
|
|
|
dist-hook:
|
|
|
|
find . -name '*.options' -exec cp -v '{}' $(distdir) ';'
|
|
|
|
find . -name '*.dict' -exec cp -v '{}' $(distdir) ';'
|
|
|
|
find . -name '*.in' -exec cp -vr '{}' $(distdir) ';'
|
|
|
|
find . -name '*.repro' -exec cp -vr '{}' $(distdir) ';'
|
|
|
|
|
|
|
|
TESTS_ENVIRONMENT = TESTS_VALGRIND="@VALGRIND_ENVIRONMENT@"
|
|
|
|
TESTS = $(PSL_TESTS)
|
|
|
|
|
|
|
|
clean-local:
|
|
|
|
rm -rf *.gc?? *.log lcov coverage.info
|
|
|
|
|
|
|
|
fuzz-coverage: $(PSL_TESTS)
|
|
|
|
find . -name '*_fuzzer' -exec ./coverage.sh '{}' ';'
|
|
|
|
|
|
|
|
oss-fuzz:
|
|
|
|
if test "$$OUT" != ""; then \
|
2017-06-14 12:45:05 +02:00
|
|
|
if $$(ldd ../src/.libs/libpsl.so|grep -q libidn2); then XLIBS="-lidn2 -lunistring"; \
|
|
|
|
elif $$(ldd ../src/.libs/libpsl.so|grep -q libidn); then XLIBS="-lidn -lunistring"; \
|
|
|
|
elif $$(ldd ../src/.libs/libpsl.so|grep -q libicu); then XLIBS="-licuuc -licudata"; \
|
|
|
|
else XLIBS=""; fi; \
|
2017-06-09 16:27:37 +02:00
|
|
|
for ccfile in *_fuzzer.c; do \
|
|
|
|
fuzzer=$$(basename $$ccfile .c); \
|
|
|
|
$$CXX $$CXXFLAGS -I$(top_srcdir)/include -I$(top_srcdir) \
|
|
|
|
"$${fuzzer}.c" -o "$${fuzzer}" \
|
|
|
|
../src/.libs/libpsl.a $${LIB_FUZZING_ENGINE} -Wl,-Bstatic \
|
2017-06-14 12:45:05 +02:00
|
|
|
$$XLIBS \
|
2017-06-09 16:27:37 +02:00
|
|
|
-Wl,-Bdynamic; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
.PHONY: oss-fuzz
|