b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | FUZZ_RULES := $(lastword $(MAKEFILE_LIST)) |
| 2 | include $(dir $(FUZZ_RULES))../../src/build.rules |
| 3 | |
| 4 | FUZZ_CFLAGS = |
| 5 | |
| 6 | ifdef LIBFUZZER |
| 7 | CC ?= clang |
| 8 | ifeq ($(CC),cc) |
| 9 | CC = clang |
| 10 | endif |
| 11 | #FUZZ_FLAGS ?= -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow |
| 12 | FUZZ_FLAGS ?= -fsanitize=fuzzer,address |
| 13 | ifndef CFLAGS |
| 14 | FUZZ_CFLAGS += $(FUZZ_FLAGS) |
| 15 | else |
| 16 | ifeq ($(CFLAGS),-MMD -O2 -Wall -g) |
| 17 | FUZZ_CFLAGS += $(FUZZ_FLAGS) |
| 18 | endif |
| 19 | endif |
| 20 | endif |
| 21 | |
| 22 | FUZZ_CFLAGS += -DCONFIG_NO_RANDOM_POOL -DTEST_FUZZ |
| 23 | export FUZZ_CFLAGS |
| 24 | CFLAGS ?= -MMD -O2 -Wall -g |
| 25 | CFLAGS += $(FUZZ_CFLAGS) |
| 26 | ifdef LIBFUZZER |
| 27 | CFLAGS += -DTEST_LIBFUZZER |
| 28 | LDFLAGS += $(FUZZ_FLAGS) |
| 29 | endif |
| 30 | |
| 31 | WPAS_SRC=../../../wpa_supplicant |
| 32 | SRC=../../../src |
| 33 | |
| 34 | CFLAGS += -I$(SRC) -I$(SRC)/utils -I$(WPAS_SRC) |
| 35 | OBJS += ../fuzzer-common.o |
| 36 | |
| 37 | # for the lib builds |
| 38 | export TEST_FUZZ=y |