Skip to contentSkip to conversation

mkconfig: split the board make target to multiple config targets

PATCH New Mingkai Hu 6 participants 12 messages Sep 9, 2009 – Sep 15, 2009 Kbuild

lore
Share & tools
lore

Mingkai Hu

author
#0 lore raw

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.

---

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(-)
mkconfig +7 -0
index b0bbbd1..4c5675b 100755
@@ -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
 
Signature · 1 line
1.6.4
author
#1 lore raw

PATCH 2/2 mpc8536: simplify the top makefile for 36-bit config

---
 Makefile                    |    4 +---
 include/configs/MPC8536DS.h |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
Makefile +1 -3
index dd01b66..9624beb 100644
@@ -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
include/configs/MPC8536DS.h +1 -1
index 4746e2e..faca805 100644
@@ -27,7 +27,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#ifdef CONFIG_MPC8536DS_36BIT
+#ifdef CONFIG_MK_36BIT
 #define CONFIG_PHYS_64BIT	1
 #endif
 
Signature · 1 line
1.6.4
#2 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

In reply to Mingkai Hu

Dear Mingkai Hu,

Quoted 14 lines · In message <[email protected]> you…

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.

---

According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:

Quoted 8 lines

- 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

Signature · 5 lines
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
"Nature is very un-American.  Nature never hurries."
- William George Jordan
#3 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

Quoted 9 lines · 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:

Quoted 10 lines

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 at denx.de

#4 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

Dear Stefan Roese,

Quoted 15 lines · In message <[email protected]> you wrote:
Quoted 4 lines

This patch breaks building for a number of boards / configurations, especially:

Quoted 10 lines

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

Quoted 3 lines

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

Signature · 5 lines
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
People are always a lot more complicated than you  think.  It's  very
important to remember that.             - Terry Pratchett, _Truckers_
#5 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

In reply to Wolfgang Denk
Quoted 63 lines

-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Friday, September 11, 2009 4:08 PM
To: Hu Mingkai-B21284
Cc: u-boot at lists.denx.de; galak at 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 <[email protected]>

Quoted 1 line · you

To simplify the top level makefile it useful to be able to

parse the

Quoted 1 line

top level makefile target to multiple individual target,

then put them

Quoted 1 line

to the config.h, leave the board config file to handle the

different

Quoted 11 lines

targets.

Note that this method uses the '_'(underline) as the delimiter when splits the board make target.

---

According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:

Quoted 8 lines

- 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

Quoted 2 lines

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

#6 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

In reply to Wolfgang Denk
Quoted 5 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you…

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]

Quoted 7 lines

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

#7 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

Quoted 17 lines · Scott Wood
Quoted 6 lines · Wolfgang Denk

In message <[email protected]

Quoted 5 lines

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]

Quoted 7 lines

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

Quoted 6 lines
Quoted 1 line

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

#8 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

Dear Kumar Gala,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Actually, I think the patch you quoted would not have had this problem --

Seems I used a bad reference; sorry for that.

Quoted 5 lines
Quoted 2 lines

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

Signature · 6 lines
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
Our OS who art in CPU, UNIX be thy name.
Thy programs run, thy syscalls done,
In kernel as it is in user!
#9 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

Quoted 23 lines

-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Saturday, September 12, 2009 2:10 AM
To: Kumar Gala
Cc: Wood Scott-B07421; Hu Mingkai-B21284; u-boot at lists.denx.de
Subject: Re: [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

Dear Kumar Gala,

In message

Quoted 3 lines · <[email protected]> you wrote:
Quoted 3 lines

Actually, I think the patch you quoted would not have had this problem --

Seems I used a bad reference; sorry for that.

Quoted 3 lines
Quoted 2 lines

unlike the one you merged, it doesn't create #defines for all boards, only those which request it by passing -t to mkconfig.

Quoted 7 lines
Quoted 1 line

I'm with Scott on this. Why not just have it be a new

explicit option

Quoted 1 line

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

#10 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

In reply to Wolfgang Denk
Quoted 35 lines · Wolfgang Denk

Dear Mingkai Hu,

Quoted 14 lines · In message <[email protected]> you…

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.

---

According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:

Quoted 8 lines

- 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:

Quoted 9 lines

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

Quoted 9 lines

favr-32-ezkit

Shall I revert that patch?

Best regards,

Wolfgang Denk

Signature · 4 lines
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
#11 lore raw

PATCH v2 1/2 mkconfig: split the board make target to multiple config targets

In reply to Mingkai Hu

Dear Mingkai Hu,

Quoted 14 lines · In message <[email protected]> you…

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.

---

According to the comments from Wolfgang and Scott, I modified the patch and made some modification over v1:

Quoted 8 lines

- 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

Signature · 4 lines
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
Hacking's just another word for nothing left to kludge.