All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
@ 2012-07-19 19:01 Emeric Vigier
  2012-07-19 19:01 ` [Buildroot] [PATCH] " Emeric Vigier
  2012-07-19 20:08 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
  0 siblings, 2 replies; 9+ messages in thread
From: Emeric Vigier @ 2012-07-19 19:01 UTC (permalink / raw)
  To: buildroot

Hi all,

I just got started with buildroot yesterday, and like it :-).
I am no Makefile expert, then often I turn into wanting to check Makefile variables.
This patch adds a capability to do so by issuing:

$ make print-<myvariable>

e.g.

$ make print-DL_DIR
DL_DIR = /home/evigier/buildroot/dl

The implementation is perhaps clumsy, I am open to advices.
Thanks, keep on the good work.

Emeric

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

* [Buildroot] [PATCH] Makefile: add variable print capabilities
  2012-07-19 19:01 [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities Emeric Vigier
@ 2012-07-19 19:01 ` Emeric Vigier
  2012-07-19 20:08 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
  1 sibling, 0 replies; 9+ 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] 9+ messages in thread

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2012-07-19 19:01 [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities Emeric Vigier
  2012-07-19 19:01 ` [Buildroot] [PATCH] " Emeric Vigier
@ 2012-07-19 20:08 ` Thomas Petazzoni
  2012-07-19 22:25   ` Émeric Vigier
  2013-05-26 19:40   ` Yann E. MORIN
  1 sibling, 2 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-07-19 20:08 UTC (permalink / raw)
  To: buildroot

Le Thu, 19 Jul 2012 15:01:17 -0400,
Emeric Vigier <emeric.vigier@savoirfairelinux.com> a ?crit :

> I just got started with buildroot yesterday, and like it :-).
> I am no Makefile expert, then often I turn into wanting to check Makefile variables.
> This patch adds a capability to do so by issuing:
> 
> $ make print-<myvariable>
> 
> e.g.
> 
> $ make print-DL_DIR
> DL_DIR = /home/evigier/buildroot/dl

Hum, is this really useful? What are the use cases? What do other
thinks about this?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2012-07-19 20:08 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
@ 2012-07-19 22:25   ` Émeric Vigier
  2013-05-26 19:40   ` Yann E. MORIN
  1 sibling, 0 replies; 9+ messages in thread
From: Émeric Vigier @ 2012-07-19 22:25 UTC (permalink / raw)
  To: buildroot



----- Mail original -----
> Le Thu, 19 Jul 2012 15:01:17 -0400,
> Emeric Vigier <emeric.vigier@savoirfairelinux.com> a ?crit :
> 
> > I just got started with buildroot yesterday, and like it :-).
> > I am no Makefile expert, then often I turn into wanting to check
> > Makefile variables.
> > This patch adds a capability to do so by issuing:
> > 
> > $ make print-<myvariable>
> > 
> > e.g.
> > 
> > $ make print-DL_DIR
> > DL_DIR = /home/evigier/buildroot/dl
> 
> Hum, is this really useful? What are the use cases? What do other
> thinks about this?

It is somehow similar to Android's "get_build_var" which is very useful to me.
$ get_build_var TARGET_OUT
out/target/product/panda/system

But maybe there are other convenient ways to retrieve those INKTV (I never know the value) variables without grepping or reading Makefile and included ones?

> 
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> 

-- 
Emeric

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

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2012-07-19 20:08 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
  2012-07-19 22:25   ` Émeric Vigier
@ 2013-05-26 19:40   ` Yann E. MORIN
  2013-05-26 19:44     ` Thomas Petazzoni
  1 sibling, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2013-05-26 19:40 UTC (permalink / raw)
  To: buildroot

Emeric, All,

On 2012-07-19 22:08 +0200, Thomas Petazzoni spake thusly:
> Le Thu, 19 Jul 2012 15:01:17 -0400,
> Emeric Vigier <emeric.vigier@savoirfairelinux.com> a ?crit :
> 
> > I just got started with buildroot yesterday, and like it :-).
> > I am no Makefile expert, then often I turn into wanting to check Makefile variables.
> > This patch adds a capability to do so by issuing:
> > 
> > $ make print-<myvariable>
> > 
> > e.g.
> > 
> > $ make print-DL_DIR
> > DL_DIR = /home/evigier/buildroot/dl
> 
> Hum, is this really useful? What are the use cases? What do other
> thinks about this?

I like the overall idea, but only for printing all variables.
It's then possible to grep the result to find the one variable one is
interested in.

I've taken that patch in my tree (dropped the per-variable print, and
adapted the printvars a bit), and will send a pull request to Peter
later tonight.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2013-05-26 19:40   ` Yann E. MORIN
@ 2013-05-26 19:44     ` Thomas Petazzoni
  2013-05-26 19:48       ` Yann E. MORIN
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2013-05-26 19:44 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 26 May 2013 21:40:14 +0200, Yann E. MORIN wrote:

> > Hum, is this really useful? What are the use cases? What do other
> > thinks about this?
> 
> I like the overall idea, but only for printing all variables.
> It's then possible to grep the result to find the one variable one is
> interested in.
> 
> I've taken that patch in my tree (dropped the per-variable print, and
> adapted the printvars a bit), and will send a pull request to Peter
> later tonight.

I would suggest to not send patches touching the core infrastructure as
part of a pull request that also has many usually uncontroversial
package changes/updates.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2013-05-26 19:44     ` Thomas Petazzoni
@ 2013-05-26 19:48       ` Yann E. MORIN
  2013-05-26 20:03         ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2013-05-26 19:48 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2013-05-26 21:44 +0200, Thomas Petazzoni spake thusly:
> Dear Yann E. MORIN,
> 
> On Sun, 26 May 2013 21:40:14 +0200, Yann E. MORIN wrote:
> 
> > > Hum, is this really useful? What are the use cases? What do other
> > > thinks about this?
> > 
> > I like the overall idea, but only for printing all variables.
> > It's then possible to grep the result to find the one variable one is
> > interested in.
> > 
> > I've taken that patch in my tree (dropped the per-variable print, and
> > adapted the printvars a bit), and will send a pull request to Peter
> > later tonight.
> 
> I would suggest to not send patches touching the core infrastructure as
> part of a pull request that also has many usually uncontroversial
> package changes/updates.

Yes, it's in a separate branch. I have three branches:
  - fixes
  - features
  - tentative

That one is on the tentative branch.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities
  2013-05-26 19:48       ` Yann E. MORIN
@ 2013-05-26 20:03         ` Thomas Petazzoni
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2013-05-26 20:03 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 26 May 2013 21:48:15 +0200, Yann E. MORIN wrote:

> Yes, it's in a separate branch. I have three branches:
>   - fixes
>   - features
>   - tentative
> 
> That one is on the tentative branch.

Excellent, thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

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

Hi all,
I just got started with buildroot yesterday, and like it :-).
I am no Makefile expert, then often I turn into wanting to check Makefile variables.
This patch adds a capability to do so by issuing:

$ make print-<myvariable>

e.g.

$ make print-DL_DIR
DL_DIR = /home/evigier/buildroot/dl

The implementation is perhaps clumsy, I am open to advices.
Thanks, keep on the good work.

Emeric

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

end of thread, other threads:[~2013-05-26 20:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 19:01 [Buildroot] [PATCH 0/1] Makefile: add variable print capabilities Emeric Vigier
2012-07-19 19:01 ` [Buildroot] [PATCH] " Emeric Vigier
2012-07-19 20:08 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
2012-07-19 22:25   ` Émeric Vigier
2013-05-26 19:40   ` Yann E. MORIN
2013-05-26 19:44     ` Thomas Petazzoni
2013-05-26 19:48       ` Yann E. MORIN
2013-05-26 20:03         ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2012-07-19 18:29 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.