From: Kumar Gala Date: Fri, 7 Aug 2009 09:03:03 -0500 Subject: [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h Message-ID: <1249653783-16727-1-git-send-email-galak@kernel.crashing.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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 " >>config.h echo "#include " >>config.h +echo -e ${DEFINES} >> config.h + exit 0 -- 1.6.0.6