[PATCH v3 25/30] tools: usb: Append extra cflags

Leo Yan posted 30 patches 1 month ago
There is a newer version of this series
[PATCH v3 25/30] tools: usb: 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/usb/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index c6235667dd46223b646bbab5c82c810221750182..db2ff5b8e5ab7b76e424df32ed5a9458daa5d516 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -13,6 +13,7 @@ endif
 # (this improves performance and avoids hard-to-debug behaviour);
 MAKEFLAGS += -r
 
+override CFLAGS += $(EXTRA_CFLAGS)
 override CFLAGS += -O2 -Wall -Wextra -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(srctree)/tools/include
 override LDFLAGS += -lpthread
 

-- 
2.34.1
Re: [PATCH v3 25/30] tools: usb: Append extra cflags
Posted by Ian Rogers 1 month ago
On Sun, Mar 8, 2026 at 9:50 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/usb/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/usb/Makefile b/tools/usb/Makefile
> index c6235667dd46223b646bbab5c82c810221750182..db2ff5b8e5ab7b76e424df32ed5a9458daa5d516 100644
> --- a/tools/usb/Makefile
> +++ b/tools/usb/Makefile
> @@ -13,6 +13,7 @@ endif
>  # (this improves performance and avoids hard-to-debug behaviour);
>  MAKEFLAGS += -r
>
> +override CFLAGS += $(EXTRA_CFLAGS)
>  override CFLAGS += -O2 -Wall -Wextra -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(srctree)/tools/include

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

Thanks,
Ian

>  override LDFLAGS += -lpthread
>
>
> --
> 2.34.1
>