From patchwork Fri Jul 26 21:37:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 262315 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 317592C0096 for ; Sat, 27 Jul 2013 07:39:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8A94B4A032; Fri, 26 Jul 2013 23:39:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id grBTkPakAasT; Fri, 26 Jul 2013 23:39:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D554F4A023; Fri, 26 Jul 2013 23:39:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 112124A019 for ; Fri, 26 Jul 2013 23:39:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vckQa9eFNgb9 for ; Fri, 26 Jul 2013 23:39:02 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by theia.denx.de (Postfix) with ESMTP id ED7094A01F for ; Fri, 26 Jul 2013 23:38:40 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2a01:e35:2eb9:21:290:f5ff:feb7:8905]) (Authenticated sender: albert.aribaud) by smtp5-g21.free.fr (Postfix) with ESMTPSA id 3D572D48031; Fri, 26 Jul 2013 23:38:33 +0200 (CEST) From: Albert ARIBAUD To: u-boot@lists.denx.de Date: Fri, 26 Jul 2013 23:37:15 +0200 Message-Id: <1374874635-12042-10-git-send-email-albert.u.boot@aribaud.net> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374874635-12042-9-git-send-email-albert.u.boot@aribaud.net> References: <1374611299-16836-1-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-1-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-2-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-3-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-4-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-5-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-6-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-7-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-8-git-send-email-albert.u.boot@aribaud.net> <1374874635-12042-9-git-send-email-albert.u.boot@aribaud.net> Subject: [U-Boot] [RFC V2 9/9] Changes due to boards.cfg reformat X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The order of boards.cfg fields has changed; modify files which depend on it. NOTES: 1. mkconfig could probably endure more cleaning; it apparently has uncertain views about what its positional parameters are at various times of its execution. However, this submission will not perform any such cleanup. 2. buildman has not been tested. 3. make xxx_config and MAKEALL -a arm have been tested. Signed-off-by: Albert ARIBAUD --- MAKEALL | 20 +++++++++++--------- Makefile | 2 +- mkconfig | 31 ++++++++++++++++--------------- tools/buildman/board.py | 2 +- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/MAKEALL b/MAKEALL index bed99de..3e895f6 100755 --- a/MAKEALL +++ b/MAKEALL @@ -160,7 +160,7 @@ FILTER="\$1 !~ /^#/" [ "$opt_v" ] && FILTER="${FILTER} && $opt_v" if [ "$SELECTED" ] ; then - SELECTED=$(awk '('"$FILTER"') { print $1 }' boards.cfg) + SELECTED=$(awk '('"$FILTER"') { print $7 }' boards.cfg) # Make sure some boards from boards.cfg are actually found if [ -z "$SELECTED" ] ; then @@ -237,7 +237,7 @@ boards_by_field() } boards_by_arch() { boards_by_field 2 "$@" ; } boards_by_cpu() { boards_by_field 3 "$@" "[: \t]+" ; } -boards_by_soc() { boards_by_field 6 "$@" ; } +boards_by_soc() { boards_by_field 4 "$@" ; } ######################################################################### ## MPC5xx Systems @@ -519,7 +519,7 @@ get_target_location() { local vendor="" # Automatic mode - local line=`egrep -i "^[[:space:]]*${target}[[:space:]]" boards.cfg` + local line=`egrep -i "[[:space:]]*${target}[[:space:]]" boards.cfg` if [ -z "${line}" ] ; then echo "" ; return ; fi @@ -532,15 +532,17 @@ get_target_location() { [ "${BOARD_NAME}" ] || BOARD_NAME="${1%_config}" - if [ "$4" = "-" ] ; then - board=${BOARD_NAME} - else - board="$4" + if [ $# -gt 5 ]; then + if [ "$6" = "-" ] ; then + board=${BOARD_NAME} + else + board="$4" + fi fi [ $# -gt 4 ] && [ "$5" != "-" ] && vendor="$5" - [ $# -gt 6 ] && [ "$7" != "-" ] && { - tmp="${7%:*}" + [ $# -gt 6 ] && [ "$8" != "-" ] && { + tmp="${8%:*}" if [ "$tmp" ] ; then CONFIG_NAME="$tmp" fi diff --git a/Makefile b/Makefile index 7206aba..4d24cfa 100644 --- a/Makefile +++ b/Makefile @@ -784,7 +784,7 @@ unconfig: sinclude $(obj).boards.depend $(obj).boards.depend: boards.cfg - @awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@ + @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE) -d" }' $< > $@ # # Functions to generate common board directory names diff --git a/mkconfig b/mkconfig index 816ae3d..1d06c8e 100755 --- a/mkconfig +++ b/mkconfig @@ -23,10 +23,11 @@ options="" if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then # Automatic mode - line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || { + line=`awk '($0 !~ /^#/ && $7 ~ /^'"$2"'$/) { print $1, $2, $3, $4, $5, $6, $7, $8 }' boards.cfg` + if [ -z "$line" ] ; then echo "make: *** No rule to make target \`$2_config'. Stop." >&2 exit 1 - } + fi set ${line} # add default board name if needed @@ -37,44 +38,44 @@ while [ $# -gt 0 ] ; do case "$1" in --) shift ; break ;; -a) shift ; APPEND=yes ;; - -n) shift ; BOARD_NAME="${1%_config}" ; shift ;; + -n) shift ; BOARD_NAME="${7%_config}" ; shift ;; -t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ; shift ;; *) break ;; esac done -[ $# -lt 4 ] && exit 1 -[ $# -gt 7 ] && exit 1 +[ $# -lt 7 ] && exit 1 +[ $# -gt 8 ] && exit 1 # Strip all options and/or _config suffixes -CONFIG_NAME="${1%_config}" +CONFIG_NAME="${7%_config}" -[ "${BOARD_NAME}" ] || BOARD_NAME="${1%_config}" +[ "${BOARD_NAME}" ] || BOARD_NAME="${7%_config}" arch="$2" cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'` spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'` -if [ "$4" = "-" ] ; then +if [ "$6" = "-" ] ; then board=${BOARD_NAME} else - board="$4" + board="$6" fi -[ $# -gt 4 ] && [ "$5" != "-" ] && vendor="$5" -[ $# -gt 5 ] && [ "$6" != "-" ] && soc="$6" -[ $# -gt 6 ] && [ "$7" != "-" ] && { +[ "$5" != "-" ] && vendor="$5" +[ "$4" != "-" ] && soc="$4" +[ $# -gt 7 ] && [ "$8" != "-" ] && { # check if we have a board config name in the options field # the options field mave have a board config name and a list # of options, both separated by a colon (':'); the options are # separated by commas (','). # # Check for board name - tmp="${7%:*}" + tmp="${8%:*}" if [ "$tmp" ] ; then CONFIG_NAME="$tmp" fi # Check if we only have a colon... - if [ "${tmp}" != "$7" ] ; then - options=${7#*:} + if [ "${tmp}" != "$8" ] ; then + options=${8#*:} TARGETS="`echo ${options} | sed 's:,: :g'` ${TARGETS}" fi } diff --git a/tools/buildman/board.py b/tools/buildman/board.py index cc7b5d0..a388896 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -63,7 +63,7 @@ class Boards: for upto in range(len(fields)): if fields[upto] == '-': fields[upto] = '' - while len(fields) < 7: + while len(fields) < 9: fields.append('') board = Board(*fields)