public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files
@ 2009-07-22  2:59 Mike Frysinger
  2009-07-22  7:12 ` Wolfgang Denk
  2009-07-23 19:44 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2009-07-22  2:59 UTC (permalink / raw)
  To: u-boot

By including autoconf.mk before config.mk, all top level files can use any
config options it sets up (like <arch>_config.mk) or the Makefile itself
without being forced to use lazy evaluation.
---
 Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 25a6254..69037b4 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,13 @@ SUBDIRS	= tools \
 
 ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
 
+# Include autoconf.mk before config.mk so that the config options are available
+# to all top level build files.  We need the dummy all: target to prevent the
+# dependency target in autoconf.mk.dep from being the default.
+all:
+sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
+
 # load ARCH, BOARD, and CPU configuration
 include $(obj)include/config.mk
 export	ARCH CPU BOARD VENDOR SOC
@@ -440,9 +447,6 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 		sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
 	mv $@.tmp $@
 
-sinclude $(obj)include/autoconf.mk.dep
-sinclude $(obj)include/autoconf.mk
-
 #########################################################################
 else	# !config.mk
 all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
-- 
1.6.3.3

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

* [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files
  2009-07-22  2:59 [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files Mike Frysinger
@ 2009-07-22  7:12 ` Wolfgang Denk
  2009-07-22  7:25   ` Mike Frysinger
  2009-07-23 19:44 ` Wolfgang Denk
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2009-07-22  7:12 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <1248231576-26757-1-git-send-email-vapier@gentoo.org> you wrote:
> By including autoconf.mk before config.mk, all top level files can use any
> config options it sets up (like <arch>_config.mk) or the Makefile itself
> without being forced to use lazy evaluation.
> ---
>  Makefile |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)

Can you please explain how this interacts with / impacts / undoes
commit 3db75d9c "fix: missing autoconfig.mk from general Makefile"?


I have to admit that I did not really understood the need for commit
3db75d9c, and neither do I in this case, so I think I better ask now
before I completely lose track of what you are doing here, or why.

[None of the systems I work with seems to need ayhting like that.]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                           -- H. L. Mencken

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

* [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files
  2009-07-22  7:12 ` Wolfgang Denk
@ 2009-07-22  7:25   ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2009-07-22  7:25 UTC (permalink / raw)
  To: u-boot

On Wednesday 22 July 2009 03:12:07 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > By including autoconf.mk before config.mk, all top level files can use
> > any config options it sets up (like <arch>_config.mk) or the Makefile
> > itself without being forced to use lazy evaluation.
> > ---
> >  Makefile |   10 +++++++---
> >  1 files changed, 7 insertions(+), 3 deletions(-)
>
> Can you please explain how this interacts with / impacts / undoes
> commit 3db75d9c "fix: missing autoconfig.mk from general Makefile"?

it complements that patch

> I have to admit that I did not really understood the need for commit
> 3db75d9c, and neither do I in this case, so I think I better ask now
> before I completely lose track of what you are doing here, or why.
>
> [None of the systems I work with seems to need ayhting like that.]

the idea is simple: use $(CONFIG_...) in top level files.  before Jean's fix, 
it wasnt possible to do this because the autoconf.mk file was included with 
"sinclude", and it was included before autoconf.mk.dep.  that means make would 
look for the file to include, not find it, and then silently skip it.  with 
Jean's fix, it would generate the file and then include it.

however, this occurs after config.mk and related files are included.  if you 
use lazy make evaluation, this really doesnt matter.  but in the Blackfin 
config.mk, i use := so that i can sanitize variables:
CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
that means CONFIG_BFIN_CPU has to be defined before my .mk file.  i could 
workaround this issue by creating a new variable like:
BFIN_CPU = $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
but then i'd have to go around and fix all the references to the variables i 
modify to use the new one, and i have to remember in the future to use the 
indirect variable rather than the CONFIG_ ones coming from the build system.  
i.e. it makes a lot more sense to keep thing sane and set it up early so as to 
avoid an ugly nest of implicit fragile rules.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090722/64e27c45/attachment.pgp 

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

* [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files
  2009-07-22  2:59 [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files Mike Frysinger
  2009-07-22  7:12 ` Wolfgang Denk
@ 2009-07-23 19:44 ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2009-07-23 19:44 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <1248231576-26757-1-git-send-email-vapier@gentoo.org> you wrote:
> By including autoconf.mk before config.mk, all top level files can use any
> config options it sets up (like <arch>_config.mk) or the Makefile itself
> without being forced to use lazy evaluation.
> ---
>  Makefile |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If it went on at this rate, in several billion  years  he'd  be  rich
beyond his wildest dreams!            - Terry Pratchett, _Soul Music_

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

end of thread, other threads:[~2009-07-23 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22  2:59 [U-Boot] [PATCH] autoconf.mk: include before config.mk for top level files Mike Frysinger
2009-07-22  7:12 ` Wolfgang Denk
2009-07-22  7:25   ` Mike Frysinger
2009-07-23 19:44 ` Wolfgang Denk

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