Patchwork [U-Boot,2/4] build/mkconfig: Add EXTRA_OPTS argument to make to modify build

login
register
mail settings
Submitter Matthew McClintock
Date June 2, 2011, 7:34 p.m.
Message ID <1307043300-11253-2-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/98476/
State Superseded
Headers show

Comments

Matthew McClintock - June 2, 2011, 7:34 p.m.
Allow users to pass in extra defines via make so they can
modify the build. Example

make P1022DS EXTRA_OPTS=NAND

is equivalent to

make P1022DS_NAND

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
 mkconfig |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Mike Frysinger - June 3, 2011, 4:56 a.m.
On Thursday, June 02, 2011 15:34:58 Matthew McClintock wrote:
> --- a/mkconfig
> +++ b/mkconfig
> @@ -81,6 +81,12 @@ if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then
>  	exit 1
>  fi
> 
> +if [ -z "${options}" ] ; then
> +options+=$EXTRA_OPTS
> +else
> +options+=,$EXTRA_OPTS
> +fi

style is broken (lacking indentation), and the "+=" operator is not in the 
POSIX shell spec
-mike

Patch

diff --git a/mkconfig b/mkconfig
index 6ff533f..e72ec3d 100755
--- a/mkconfig
+++ b/mkconfig
@@ -81,6 +81,12 @@  if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then
 	exit 1
 fi
 
+if [ -z "${options}" ] ; then
+options+=$EXTRA_OPTS
+else
+options+=,$EXTRA_OPTS
+fi
+
 if [ "$options" ] ; then
 	echo "Configuring for ${BOARD_NAME} - Board: ${CONFIG_NAME}, Options: ${options}"
 else
@@ -146,7 +152,7 @@  else
 	> config.h		# Create new config file
 fi
 echo "/* Automatically generated - do not edit */" >>config.h
-
+TARGETS+=`echo $EXTRA_OPTS | tr ',' ' '`
 for i in ${TARGETS} ; do
 	i="`echo ${i} | sed '/=/ {s/=/\t/;q } ; { s/$/\t1/ }'`"
 	echo "#define CONFIG_${i}" >>config.h ;