public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets
@ 2009-09-09  3:23 Mingkai Hu
  2009-09-09  3:23 ` [U-Boot] [PATCH 2/2] mpc8536: simplify the top makefile for 36-bit config Mingkai Hu
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Mingkai Hu @ 2009-09-09  3:23 UTC (permalink / raw)
  To: u-boot

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

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

end of thread, other threads:[~2009-09-15 20:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09  3:23 [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets Mingkai Hu
2009-09-09  3:23 ` [U-Boot] [PATCH 2/2] mpc8536: simplify the top makefile for 36-bit config Mingkai Hu
2009-09-11  8:07 ` [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets Wolfgang Denk
2009-09-11  8:12   ` Stefan Roese
2009-09-11  8:25     ` Wolfgang Denk
2009-09-11  8:46   ` Hu Mingkai-B21284
2009-09-11 15:20   ` Scott Wood
2009-09-11 15:35     ` Kumar Gala
2009-09-11 18:09       ` Wolfgang Denk
2009-09-14  2:44         ` Hu Mingkai-B21284
2009-09-14 12:47   ` Michal Simek
2009-09-15 20:20 ` Wolfgang Denk

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