From: Matthew McClintock Date: Fri, 3 Jun 2011 13:36:03 -0500 Subject: [U-Boot] [PATCH v2 2/4] build/mkconfig: Add EXTRA_OPTS argument to make to modify build In-Reply-To: <201106030049.52598.vapier@gentoo.org> References: <201106030049.52598.vapier@gentoo.org> Message-ID: <1307126163-24859-1-git-send-email-msm@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- v2: Fix tab indention, fix posix compliance mkconfig | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/mkconfig b/mkconfig index 6ff533f..bc6ce06 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="$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 ; -- 1.7.5