From: Matthew McClintock Date: Fri, 3 Jun 2011 15:07:51 -0500 Subject: [U-Boot] [PATCH v3 2/4] build/mkconfig: Add EXTRA_OPTS argument to make to modify build In-Reply-To: <201106031524.48868.vapier@gentoo.org> References: <201106031524.48868.vapier@gentoo.org> Message-ID: <1307131671-22745-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 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