From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h
Date: Fri, 7 Aug 2009 09:03:03 -0500 [thread overview]
Message-ID: <1249653783-16727-1-git-send-email-galak@kernel.crashing.org> (raw)
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
next reply other threads:[~2009-08-07 14:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-07 14:03 Kumar Gala [this message]
2009-08-07 19:22 ` [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249653783-16727-1-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox