public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h
@ 2009-08-07 14:03 Kumar Gala
  2009-08-07 19:22 ` Scott Wood
  0 siblings, 1 reply; 10+ messages in thread
From: Kumar Gala @ 2009-08-07 14:03 UTC (permalink / raw)
  To: u-boot

To simplify the top level makefile it useful to be able to set
some #defines in config.h to express different configurations.

Added a -D option that allows us to replace:

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

with:

MPC8536DS_36BIT_config \
MPC8536DS_config:       unconfig
	@$(MKCONFIG) -D $(@:_config=)=1 MPC8536DS ppc mpc85xx mpc8536ds freescale

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 mkconfig |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mkconfig b/mkconfig
index b0bbbd1..8d778e5 100755
--- a/mkconfig
+++ b/mkconfig
@@ -10,12 +10,14 @@
 
 APPEND=no	# Default: Create new config file
 BOARD_NAME=""	# Name to print in make output
+DEFINES=""
 
 while [ $# -gt 0 ] ; do
 	case "$1" in
 	--) shift ; break ;;
 	-a) shift ; APPEND=yes ;;
 	-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
+	-D) shift ; DEFINES="#define ${1/=/\t}\n"${DEFINES} ; shift ;;
 	*)  break ;;
 	esac
 done
@@ -84,5 +86,7 @@ fi
 echo "/* Automatically generated - do not edit */" >>config.h
 echo "#include <configs/$1.h>" >>config.h
 echo "#include <asm/config.h>" >>config.h
+echo -e ${DEFINES} >> config.h
+
 
 exit 0
-- 
1.6.0.6

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

end of thread, other threads:[~2009-08-13 22:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 14:03 [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h Kumar Gala
2009-08-07 19:22 ` Scott Wood
2009-08-13  5:15   ` Mike Frysinger
2009-08-13 15:28     ` Scott Wood
2009-08-13 18:26       ` Mike Frysinger
2009-08-13 18:38         ` Scott Wood
2009-08-13 20:02           ` Mike Frysinger
2009-08-13 20:15             ` Wolfgang Denk
2009-08-13 20:23               ` Mike Frysinger
2009-08-13 22:01               ` Scott Wood

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