Re: [PATCH v3 23/30] tools: spi: Append extra cflags

From: Ian Rogers

Date: Mon Mar 09 2026 - 14:10:11 EST


On Sun, Mar 8, 2026 at 9:49 AM Leo Yan <leo.yan@xxxxxxx> wrote:
>
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
>
> Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
> ---
> tools/spi/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/spi/Makefile b/tools/spi/Makefile
> index 7fccd245a53515ab019529c8e5e91a044eaaa68b..1e3b3f91634cc2561c434c02f812942fa881685f 100644
> --- a/tools/spi/Makefile
> +++ b/tools/spi/Makefile
> @@ -12,6 +12,7 @@ endif
> # (this improves performance and avoids hard-to-debug behaviour);
> MAKEFLAGS += -r
>
> +CFLAGS += $(EXTRA_CFLAGS)
> CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include

The append should probably happen last to allow the default values to
be overridden.

Thanks,
Ian

> ALL_TARGETS := spidev_test spidev_fdx
>
> --
> 2.34.1
>