From 911da26f96d630a9c1ad3cd9748f689ab170ad52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Sat, 8 Apr 2023 18:27:09 +0200 Subject: [PATCH] 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". --- test/fuzz/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fuzz/Makefile b/test/fuzz/Makefile index 109960f7..98c17464 100644 --- a/test/fuzz/Makefile +++ b/test/fuzz/Makefile @@ -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)