test/fuzz: Fix CC default value in makefile

Unfortunately, CC ?= afl-gcc doesn't work. This is because CC has a
default value (of "cc"), and the ?= operator only assigns a value if the
variable previously had none. "make" currently compiles with cc.

In this patch, I implemented the more elaborate way to achieve what was
probably intended: "make" will use afl-gcc now, and "make CC=foo" will
compile with "foo".
This commit is contained in:
Jonathan Neuschäfer 2023-04-08 18:27:09 +02:00 committed by Simon Goldschmidt
parent 2e3dcf06d1
commit 911da26f96

View File

@ -32,7 +32,10 @@
all compile: lwip_fuzz lwip_fuzz2 lwip_fuzz3
.PHONY: all clean
CC?=afl-gcc
ifeq ($(origin CC), default)
CC=afl-gcc
endif
LDFLAGS=-lm
# use 'make D=-DUSER_DEFINE' to pass a user define to gcc
CFLAGS=-O0 $(D)