From 3443db75b0f0dbd668b789490f486b352179c907 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Tue, 2 Aug 2022 14:35:59 +0200 Subject: [PATCH] Makefile: error out printvars target when VARS is empty or unset 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 Signed-off-by: Quentin Schulz Signed-off-by: Yann E. MORIN (cherry picked from commit ec82347cdee190a5fa451b83cdb3727c78cda315) Signed-off-by: Peter Korsgaard --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index dc9916b35d..e8a4703a51 100644 --- a/Makefile +++ b/Makefile @@ -1059,6 +1059,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'" + @exit 1 +endif @: $(foreach V, \ $(sort $(foreach X, $(.VARIABLES), $(filter $(VARS),$(X)))), \