[PATCH u-boot-marvell v2 05/20] arm: mvebu: Generate kwbimage.cfg with $(call cmd, ...)

Stefan Roese sr at denx.de
Thu Jan 13 07:32:56 CET 2022


On 1/12/22 18:20, Pali Rohár wrote:
> Usage of $(call cmd,...) is standard way to call other commands which
> generate things.
> 
> It also has the advantage of printing build information in the form
>    KWBCFG  arch/arm/mach-mvebu/kwbimage.cfg
> if verbosity is disabled, and printing the build command otherwise.
> 
> Note that the '#' character needs to be escaped in Makefile when used as
> value for make variable assignment.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/mach-mvebu/Makefile | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
> index 7e9c206ed6b8..acbaa6449d3d 100644
> --- a/arch/arm/mach-mvebu/Makefile
> +++ b/arch/arm/mach-mvebu/Makefile
> @@ -58,10 +58,13 @@ KWB_REPLACE += SEC_FUSE_DUMP
>   KWB_CFG_SEC_FUSE_DUMP = a38x
>   endif
>   
> +quiet_cmd_kwbcfg = KWBCFG  $@
> +cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/^\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
> +	<$< >$(dir $@)$(@F)
> +
>   $(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
>   		include/config/auto.conf
> -	$(Q)sed -ne '$(foreach V,$(KWB_REPLACE),s/^#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
> -	<$< >$(dir $@)$(@F)
> +	$(call cmd,kwbcfg)
>   
>   endif # CONFIG_SPL_BUILD
>   obj-y	+= gpio.o
> 

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list