[U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
Note that this method uses the '_'(underline) as the delimiter when splits the board make target.
Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com ---
According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:
- remove the sectence thats puts the splited variables to the config.mk, we can use the CONFIG_MK_* in the board config file to override the variable in the board config file.
- change CONFIG_OPT_* to CONFIG_MK_*
mkconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/mkconfig b/mkconfig index b0bbbd1..4c5675b 100755 --- a/mkconfig +++ b/mkconfig @@ -10,12 +10,14 @@
APPEND=no # Default: Create new config file BOARD_NAME="" # Name to print in make output +TARGETS=""
while [ $# -gt 0 ] ; do case "$1" in --) shift ; break ;; -a) shift ; APPEND=yes ;; -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;; + -t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ; shift ;; *) break ;; esac done @@ -82,6 +84,11 @@ else > config.h # Create new config file fi echo "/* Automatically generated - do not edit */" >>config.h + +for i in ${TARGETS} ; do + echo "#define CONFIG_MK_${i} 1" >>config.h ; +done + echo "#include <configs/$1.h>" >>config.h echo "#include <asm/config.h>" >>config.h

Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com --- Makefile | 4 +--- include/configs/MPC8536DS.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index dd01b66..9624beb 100644 --- a/Makefile +++ b/Makefile @@ -2444,9 +2444,7 @@ ATUM8548_config: unconfig
MPC8536DS_36BIT_config \ MPC8536DS_config: unconfig - @mkdir -p $(obj)include - @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a MPC8536DS ppc mpc85xx mpc8536ds freescale + @$(MKCONFIG) -t $(@:_config=) MPC8536DS ppc mpc85xx mpc8536ds freescale
MPC8540ADS_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8540ads freescale diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h index 4746e2e..faca805 100644 --- a/include/configs/MPC8536DS.h +++ b/include/configs/MPC8536DS.h @@ -27,7 +27,7 @@ #ifndef __CONFIG_H #define __CONFIG_H
-#ifdef CONFIG_MPC8536DS_36BIT +#ifdef CONFIG_MK_36BIT #define CONFIG_PHYS_64BIT 1 #endif

Dear Mingkai Hu,
In message 1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com you wrote:
To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
Note that this method uses the '_'(underline) as the delimiter when splits the board make target.
Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com
According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:
remove the sectence thats puts the splited variables to the config.mk, we can use the CONFIG_MK_* in the board config file to override the variable in the board config file.
change CONFIG_OPT_* to CONFIG_MK_*
mkconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations, especially:
xilinx-ppc405-generic_flash xilinx-ppc405-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic VoVPN-GW_66MHz VoVPN-GW_100MHz EB+MCF-EV123 EB+MCF-EV123_internal microblaze-generic favr-32-ezkit
Shall I revert that patch?
Best regards,
Wolfgang Denk

On Friday 11 September 2009 10:07:46 Wolfgang Denk wrote:
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations, especially:
xilinx-ppc405-generic_flash xilinx-ppc405-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic VoVPN-GW_66MHz VoVPN-GW_100MHz EB+MCF-EV123 EB+MCF-EV123_internal microblaze-generic favr-32-ezkit
Yes, I just stumbled over the build failure here as well. It seems to be a problem with the "-" in the board target name. Not sure how this could be solved though.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

Dear Stefan Roese,
In message 200909111012.07310.sr@denx.de you wrote:
This patch breaks building for a number of boards / configurations, especially:
xilinx-ppc405-generic_flash xilinx-ppc405-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic VoVPN-GW_66MHz VoVPN-GW_100MHz EB+MCF-EV123 EB+MCF-EV123_internal microblaze-generic favr-32-ezkit
Yes, I just stumbled over the build failure here as well. It seems to be a problem with the "-" in the board target name. Not sure how this could be solved though.
Yes. The modification was based on the assumption that Make target names _and_ board config file names could be used as valid C identifiers, which is obviously not the case.
Of course we could rename the respective Make targets and directories, but this is (1) some effort and (2) requires negotiation with the respective board maintainers, as documentation, build scripts and other things may be effected by such a change.
Alternatively, we could filter out such problematic characters, but then again we have to check which side effects this may cause.
All together: this patch needs a lot more thinking and more careful testing.
I tend to revert it.
Best regards,
Wolfgang Denk

-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Friday, September 11, 2009 4:08 PM To: Hu Mingkai-B21284 Cc: u-boot@lists.denx.de; galak@kernel.crashing.org; Wood Scott-B07421 Subject: Re: [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets
Dear Mingkai Hu,
In message 1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com you wrote:
To simplify the top level makefile it useful to be able to
parse the
top level makefile target to multiple individual target,
then put them
to the config.h, leave the board config file to handle the
different
targets.
Note that this method uses the '_'(underline) as the delimiter when splits the board make target.
Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com
According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:
remove the sectence thats puts the splited variables to the config.mk, we can use the CONFIG_MK_* in the board config file to override the variable in the board config file.
change CONFIG_OPT_* to CONFIG_MK_*
mkconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations, especially:
xilinx-ppc405-generic_flash xilinx-ppc405-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic VoVPN-GW_66MHz VoVPN-GW_100MHz EB+MCF-EV123 EB+MCF-EV123_internal microblaze-generic favr-32-ezkit
Shall I revert that patch?
Oh..., sorry, I don't run makeall to test and fell free to revert it, but not this patch, this patch doesn't be included on your git tree, I think you means the following patch: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=511c02f611 cb5afa1b8ca5980caaaabaa0de377f
Obviously, this patch also causes these issues, so can I parse the board config name in the top make file by using the "findstring" method which will make the top make file a little lengthy? If yes, I'll resend the patchset for boot from NAND/eSDHC/eSPI again.
Thanks, Mingkai

On Fri, Sep 11, 2009 at 10:07:46AM +0200, Wolfgang Denk wrote:
In message 1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com you wrote:
To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
[snip]
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations,
Actually, I think the patch you quoted would not have had this problem -- unlike the one you merged, it doesn't create #defines for all boards, only those which request it by passing -t to mkconfig.
-Scott

On Sep 11, 2009, at 10:20 AM, Scott Wood wrote:
On Fri, Sep 11, 2009 at 10:07:46AM +0200, Wolfgang Denk wrote:
In message <1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com
you wrote: To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
[snip]
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations,
Actually, I think the patch you quoted would not have had this problem -- unlike the one you merged, it doesn't create #defines for all boards, only those which request it by passing -t to mkconfig.
I'm with Scott on this. Why not just have it be a new explicit option to mkconfig?
- k

Dear Kumar Gala,
In message C93D00E1-0D25-40AB-AAD9-707DDFD30735@kernel.crashing.org you wrote:
Actually, I think the patch you quoted would not have had this problem --
Seems I used a bad reference; sorry for that.
unlike the one you merged, it doesn't create #defines for all boards, only those which request it by passing -t to mkconfig.
I'm with Scott on this. Why not just have it be a new explicit option to mkconfig?
It's OK with me - and probably the least difficult way to solve the issue. Who will prepare a patch?
Best regards,
Wolfgang Denk

-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Saturday, September 12, 2009 2:10 AM To: Kumar Gala Cc: Wood Scott-B07421; Hu Mingkai-B21284; u-boot@lists.denx.de Subject: Re: [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets
Dear Kumar Gala,
In message C93D00E1-0D25-40AB-AAD9-707DDFD30735@kernel.crashing.org you wrote:
Actually, I think the patch you quoted would not have had this problem --
Seems I used a bad reference; sorry for that.
unlike the one you merged, it doesn't create #defines for all boards, only those which request it by passing -t to mkconfig.
I'm with Scott on this. Why not just have it be a new
explicit option
to mkconfig?
It's OK with me - and probably the least difficult way to solve the issue. Who will prepare a patch?
I've submitted this patch a few days ago which is you quoted: http://lists.denx.de/pipermail/u-boot/2009-September/060268.html
Thanks, Mingkai

Wolfgang Denk wrote:
Dear Mingkai Hu,
In message 1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com you wrote:
To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
Note that this method uses the '_'(underline) as the delimiter when splits the board make target.
Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com
According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:
remove the sectence thats puts the splited variables to the config.mk, we can use the CONFIG_MK_* in the board config file to override the variable in the board config file.
change CONFIG_OPT_* to CONFIG_MK_*
mkconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Arghhh... It seems this patch has not been well tested. Obviously never ever ran a MAKEALL over all PPC boards. It causes tons of messages like that:
include/config.h:2:25: warning: missing whitespace after the macro name
This patch breaks building for a number of boards / configurations, especially:
xilinx-ppc405-generic_flash xilinx-ppc405-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic VoVPN-GW_66MHz VoVPN-GW_100MHz EB+MCF-EV123 EB+MCF-EV123_internal microblaze-generic
I can confirm problem on Microblaze.
Please revert that patches.
Thanks, Michal
favr-32-ezkit
Shall I revert that patch?
Best regards,
Wolfgang Denk

Dear Mingkai Hu,
In message 1252466603-25103-1-git-send-email-Mingkai.hu@freescale.com you wrote:
To simplify the top level makefile it useful to be able to parse the top level makefile target to multiple individual target, then put them to the config.h, leave the board config file to handle the different targets.
Note that this method uses the '_'(underline) as the delimiter when splits the board make target.
Signed-off-by: Mingkai Hu Mingkai.hu@freescale.com
According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:
remove the sectence thats puts the splited variables to the config.mk, we can use the CONFIG_MK_* in the board config file to override the variable in the board config file.
change CONFIG_OPT_* to CONFIG_MK_*
mkconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Applied, thanks. Thsi also reverts commit 511c02f611cb5afa1b8ca5980caaaabaa0de377f.
Sorry for the confusion I caused by picking the wrong version of this patch.
Best regards,
Wolfgang Denk
participants (7)
-
Hu Mingkai-B21284
-
Kumar Gala
-
Michal Simek
-
Mingkai Hu
-
Scott Wood
-
Stefan Roese
-
Wolfgang Denk