[Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset

David Laight David.Laight at ACULAB.COM
Thu Aug 4 08:00:26 UTC 2022


From: Yann E.MORIN
> Sent: 03 August 2022 18:05
> 
> printvars returns nothing when VARS is not passed or empty. This is done
> on purpose, see commit fd5bd12379dc ("Makefile: printvars: don't print
> anything when VARS is not set").
> 
> An error message making explicit what is required from the user in order
> to use printvars is however better than silently doing nothing.
> 
> This adds a check for a non-empty VARS variable.
> 
> Cc: Quentin Schulz <foss+buildroot at 0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
> ---
>  Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 07b594ea8a..5f266e36b2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1058,6 +1058,10 @@ endif
>  # to workaround a bug in make 4.3; see https://savannah.gnu.org/bugs/?59093
>  .PHONY: printvars
>  printvars:
> +ifndef VARS
> +	@echo "Please pass a non-empty VARS to 'make printvars'"

Shouldn't that have a >&2 ??

	David

	
> +	@exit 1
> +endif
>  	@:
>  	$(foreach V, \
>  		$(sort $(foreach X, $(.VARIABLES), $(filter $(VARS),$(X)))), \
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)




More information about the buildroot mailing list