public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* How to share variables with a sub-make command in a Kbuild Makefile?
@ 2013-02-09 16:34 Joel A Fernandes
  2013-02-09 16:42 ` Joel A Fernandes
  2013-02-21 23:01 ` Michal Marek
  0 siblings, 2 replies; 3+ messages in thread
From: Joel A Fernandes @ 2013-02-09 16:34 UTC (permalink / raw)
  To: linux-kbuild

Hi,
I am trying to create a patch that involves a call to a submake and
sharing a variable with it.

The the top level Makefile is arch/arm/Makefile and has something like:
dtbs: scripts
   $(Q)$(MAKE) -e $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs
   # Make use of share-var modified by the submake
   echo $(share-var)

In the sub-make Makefile, I want to modify a variable and have it
reflect in the top Makefile
dtbs: $(addprefix $(obj)/, $(dtb-y))
   $(Q)rm -f $(obj)/../*.dtb
   share-var += "new stuff"

I tried exporting share-var from the top-level Makefile but it doesn't work.
Is there an easy way to do this?
How does the kernel do it with obj-y variables where it recursively
has the variable updated?

The reason I need this variable in the top-level Makefile is because
there are other targets in the top-level Makefile (arch/arm/Makefile)
that need access to this variable for its purpose.

Thanks in advance,
  Joel Fernandes

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

end of thread, other threads:[~2013-02-21 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-09 16:34 How to share variables with a sub-make command in a Kbuild Makefile? Joel A Fernandes
2013-02-09 16:42 ` Joel A Fernandes
2013-02-21 23:01 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox