All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Makefile: add variable print capabilities
@ 2013-05-28 22:41 Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2013-05-28 22:41 UTC (permalink / raw)
  To: buildroot

From: ?meric Vigier <emeric.vigier@savoirfairelinux.com>

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 <emeric.vigier@savoirfairelinux.com>
[yann.morin.1998 at free.fr: drop per-variable print; refresh patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a57975e..225bc13 100644
--- a/Makefile
+++ b/Makefile
@@ -402,7 +402,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) \
 	$(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
@@ -730,6 +730,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) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging \
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Makefile: add variable print capabilities
  2012-07-19 19:01 [Buildroot] [PATCH 0/1] " Emeric Vigier
@ 2012-07-19 19:01 ` Emeric Vigier
  0 siblings, 0 replies; 3+ messages in thread
From: Emeric Vigier @ 2012-07-19 19:01 UTC (permalink / raw)
  To: buildroot

Taken from http://www.cmcrossroads.com/ask-mr-make/
6521-dumping-every-makefile-variable

Signed-off-by: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
---
 Makefile |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index d55b136..901c3c3 100644
--- a/Makefile
+++ b/Makefile
@@ -369,7 +369,8 @@ world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
 	$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
 	$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
 	$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
-	$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
+	$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) \
+	printvars
 
 #############################################################
 #
@@ -377,6 +378,14 @@ world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
 # dependencies anywhere else
 #
 #############################################################
+printvars:
+	@$(foreach V,$(sort $(.VARIABLES)), \
+	$(if $(filter-out environment% default automatic, \
+	$(origin $V)),$(warning $V=$($V) ($(value $V)))))
+
+print-%:
+	@echo $* = $($*)
+
 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR):
 	@mkdir -p $@
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Makefile: add variable print capabilities
  2012-07-19 18:29 [Buildroot] [PATCH 0/1] " Emeric Vigier
@ 2012-07-19 18:29 ` Emeric Vigier
  0 siblings, 0 replies; 3+ messages in thread
From: Emeric Vigier @ 2012-07-19 18:29 UTC (permalink / raw)
  To: buildroot

Taken from http://www.cmcrossroads.com/ask-mr-make/
6521-dumping-every-makefile-variable

Signed-off-by: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
---
 Makefile |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index d55b136..901c3c3 100644
--- a/Makefile
+++ b/Makefile
@@ -369,7 +369,8 @@ world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
 	$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
 	$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
 	$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
-	$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
+	$(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) \
+	printvars
 
 #############################################################
 #
@@ -377,6 +378,14 @@ world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
 # dependencies anywhere else
 #
 #############################################################
+printvars:
+	@$(foreach V,$(sort $(.VARIABLES)), \
+	$(if $(filter-out environment% default automatic, \
+	$(origin $V)),$(warning $V=$($V) ($(value $V)))))
+
+print-%:
+	@echo $* = $($*)
+
 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR):
 	@mkdir -p $@
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-28 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-28 22:41 [Buildroot] [PATCH] Makefile: add variable print capabilities Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2012-07-19 19:01 [Buildroot] [PATCH 0/1] " Emeric Vigier
2012-07-19 19:01 ` [Buildroot] [PATCH] " Emeric Vigier
2012-07-19 18:29 [Buildroot] [PATCH 0/1] " Emeric Vigier
2012-07-19 18:29 ` [Buildroot] [PATCH] " Emeric Vigier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.