From: Émeric Vigier Date: Tue, 28 May 2013 22:41:11 +0000 (+0200) Subject: Makefile: add variable print capabilities X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98b616d7610e315e4270000fa34d35b875790b29;p=buildroot.git Makefile: add variable print capabilities Add a new goal that dumps all of our variables. Taken from http://www.cmcrossroads.com/ask-mr-make/6521-dumping-every-makefile-variable Signed-off-by: Emeric Vigier [yann.morin.1998@free.fr: drop per-variable print; refresh patch] Signed-off-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- diff --git a/Makefile b/Makefile index 0cd7f5541f..5a0c64a52a 100644 --- a/Makefile +++ b/Makefile @@ -407,7 +407,7 @@ toolchain: prepare dirs dependencies $(BASE_TARGETS) world: toolchain $(TARGETS_ALL) .PHONY: all world toolchain dirs clean distclean source outputmakefile \ - legal-info legal-info-prepare legal-info-clean \ + legal-info legal-info-prepare legal-info-clean printvars \ $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \ $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ @@ -731,6 +731,14 @@ ifeq ($(NEED_WRAPPER),y) $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O) endif +# printvars prints all the variables currently defined in our Makefiles +printvars: + @$(foreach V, \ + $(sort $(.VARIABLES)), \ + $(if $(filter-out environment% default automatic, \ + $(origin $V)), \ + $(info $V=$($V) ($(value $V))))) + clean: rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ $(STAMP_DIR) $(BUILD_DIR) $(BASE_DIR)/staging \