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

Leo Yan posted 30 patches 1 month ago
There is a newer version of this series
[PATCH v3 23/30] tools: spi: Append extra cflags
Posted by Leo Yan 1 month ago
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 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
 
 ALL_TARGETS := spidev_test spidev_fdx

-- 
2.34.1
Re: [PATCH v3 23/30] tools: spi: Append extra cflags
Posted by Ian Rogers 1 month ago
On Sun, Mar 8, 2026 at 9:49 AM Leo Yan <leo.yan@arm.com> wrote:
>
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
>  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
>
Re: [PATCH v3 23/30] tools: spi: Append extra cflags
Posted by Mark Brown 1 month ago
On Sun, Mar 08, 2026 at 04:46:28PM +0000, Leo Yan wrote:
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.

Acked-by: Mark Brown <broonie@kernel.org>