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

Matthew McClintock msm at freescale.com
Fri Jun 3 22:07:51 CEST 2011


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 at freescale.com>
---
v2: Fix tab indention, fix posix compliance
v3: Move appending $EXTRA_OPTS up higher before we set $TARGETS so we
    only need to append $EXTRA_OPTS to $options and not $TARGETS

 mkconfig |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mkconfig b/mkconfig
index 6ff533f..77ddc1b 100755
--- a/mkconfig
+++ b/mkconfig
@@ -72,9 +72,13 @@ fi
 	# Check if we only have a colon...
 	if [ "${tmp}" != "$7" ] ; then
 		options=${7#*:}
-		TARGETS="`echo ${options} | sed 's:,: :g'` ${TARGETS}"
 	fi
 }
+# Append options passed in via EXTRA_OPTS
+if [ -n "$EXTRA_OPTS" ] ; then
+	options=${options:+${options},}${EXTRA_OPTS}
+fi
+TARGETS="`echo ${options} | sed 's:,: :g'` ${TARGETS}"
 
 if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then
 	echo "Failed: \$ARCH=${ARCH}, should be '${arch}' for ${BOARD_NAME}" 1>&2
-- 
1.7.5




More information about the U-Boot mailing list