You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.7 KiB

# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2019 Intel Corporation
# All rights reserved.
TEST_EXTENSIONS += .fuzz
FUZZ_LOG_COMPILER = $(srcdir)/script/fuzz-log-compiler.sh
INCLUDE_DIRS += -I$(srcdir)/test/fuzz/tcti
TESTS_LIBADD = $(lib_LTLIBRARIES) $(libtss2_mu) $(libtss2_sys) $(libutil)
EXTRA_DIST += test/fuzz/main-sapi.cpp
# tcti library used for fuzzing
if ENABLE_TCTI_FUZZING
libtss2_tcti_fuzzing = test/fuzz/tcti/libtss2-tcti-fuzzing.la
check_LTLIBRARIES += $(libtss2_tcti_fuzzing)
test_fuzz_tcti_libtss2_tcti_fuzzing_la_LIBADD = $(TESTS_LIBADD)
test_fuzz_tcti_libtss2_tcti_fuzzing_la_SOURCES = \
src/tss2-tcti/tcti-common.c src/tss2-tcti/tcti-common.h \
test/fuzz/tcti/tcti-fuzzing.c test/fuzz/tcti/tcti-fuzzing.h \
test/fuzz/tcti/tss2_tcti_fuzzing.h
endif # ENABLE_TCTI_FUZZING
if ENABLE_FUZZING
FUZZ_CFLAGS = $(TESTS_CFLAGS) -I$(srcdir)/test/integration
FUZZ_CPPFLAGS = $(INCLUDE_DIRS) -I$(srcdir)/test/integration $(LIB_FUZZING_ENGINE)
libtss2_utils_fuzzing = test/fuzz/libfuzz_utils.la
check_LTLIBRARIES += $(libtss2_utils_fuzzing)
test_fuzz_libfuzz_utils_la_LDFLAGS = $(TESTS_LDFLAGS)
test_fuzz_libfuzz_utils_la_LIBADD = $(TESTS_LIBADD)
test_fuzz_libfuzz_utils_la_CFLAGS = $(AM_CFLAGS) $(FUZZ_CFLAGS)
test_fuzz_libfuzz_utils_la_SOURCES = \
test/integration/sapi-context-util.c \
test/integration/sapi-test-options.c
TESTS_LDADD += $(libtss2_utils_fuzzing)
FUZZLDADD = $(TESTS_LDADD) $(TESTS_LDFLAGS) $(FUZZ_LDFLAGS)
fuzzdir = $(srcdir)
fuzz-targets: $(fuzz_PROGRAMS)
check_PROGRAMS += $(TESTS_FUZZ)
TESTS += $(TESTS_FUZZ)
fuzz_PROGRAMS = $(TESTS_FUZZ)
FUZZ = $(check_PROGRAMS)
DISTCLEANFILES += Makefile-fuzz-generated.am
include Makefile-fuzz-generated.am
endif # ENABLE_FUZZING