hostapd/tests/fuzzing/rules.include
Johannes Berg 87098d3324 build: Put archive files into build/ folder too
This is something I hadn't previously done, but there are
cases where it's needed, e.g., building 'wlantest' and then
one of the tests/fuzzing/*/ projects, they use a different
configuration (fuzzing vs. not fuzzing).

Perhaps more importantly, this gets rid of the last thing
that was dumped into the source directories, apart from
the binaries themselves.

Note that due to the use of thin archives, this required
building with absolute paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-11 11:16:00 +03:00

31 lines
689 B
Text

FUZZ_RULES := $(lastword $(MAKEFILE_LIST))
include $(dir $(FUZZ_RULES))../../src/build.rules
FUZZ_CFLAGS =
ifdef LIBFUZZER
CC ?= clang
#FUZZ_FLAGS ?= -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
FUZZ_FLAGS ?= -fsanitize=fuzzer,address
ifndef CFLAGS
FUZZ_CFLAGS += $(FUZZ_FLAGS)
endif
endif
FUZZ_CFLAGS += -DCONFIG_NO_RANDOM_POOL -DTEST_FUZZ
export FUZZ_CFLAGS
CFLAGS ?= -MMD -O2 -Wall -g
CFLAGS += $(FUZZ_CFLAGS)
ifdef LIBFUZZER
CFLAGS += -DTEST_LIBFUZZER
LDFLAGS += $(FUZZ_FLAGS)
endif
WPAS_SRC=../../../wpa_supplicant
SRC=../../../src
CFLAGS += -I$(SRC) -I$(SRC)/utils -I$(WPAS_SRC)
OBJS += ../fuzzer-common.o
# for the lib builds
export TEST_FUZZ=y