d438b4a3ce
src/*/Makefile needs to allow additional CFLAGS values to be provided from the calling Makefiles so that the clang command line arguments to enable sanitizers consistently. In addition, it can be useful to be able to provide CC, CFLAGS, and LDFLAGS from external setup while still requesing LIBFUZZER=y build. Allow that by not overriding these variables if they are already set. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
31 lines
343 B
Text
31 lines
343 B
Text
ifndef CC
|
|
CC=gcc
|
|
endif
|
|
|
|
ifndef CFLAGS
|
|
CFLAGS = -MMD -O2 -Wall -g
|
|
endif
|
|
|
|
ifdef TEST_FUZZ
|
|
CFLAGS += -DCONFIG_NO_RANDOM_POOL
|
|
CFLAGS += -DTEST_FUZZ
|
|
endif
|
|
|
|
CFLAGS += $(FUZZ_CFLAGS)
|
|
CFLAGS += -I.. -I../utils
|
|
|
|
|
|
Q=@
|
|
E=echo
|
|
ifeq ($(V), 1)
|
|
Q=
|
|
E=true
|
|
endif
|
|
ifeq ($(QUIET), 1)
|
|
Q=@
|
|
E=true
|
|
endif
|
|
|
|
%.o: %.c
|
|
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
|
@$(E) " CC " $<
|