abuild: allow users to specify multiple boards

Specifying a directory with multiple boards (eg abuild -t google/veyron)
makes abuild run through all of them.

Change-Id: Ifb60f3a1f0c4a727dc43c48671ea90711ffe5585
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/12278
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Georgi 2015-10-31 00:42:50 +01:00 committed by Patrick Georgi
parent c2050f014d
commit 0c65dccd3f
1 changed files with 14 additions and 12 deletions

View File

@ -551,25 +551,25 @@ if [ "$cpus" != "1" ]; then
if [ "$cpus" = "max" ]; then if [ "$cpus" = "max" ]; then
cpus=32 cpus=32
fi fi
if [ "$target" = "" ]; then
# Test if xargs supports the non-standard -P flag # Test if xargs supports the non-standard -P flag
# FIXME: disabled until we managed to eliminate all the make(1) quirks # FIXME: disabled until we managed to eliminate all the make(1) quirks
echo | xargs -P ${cpus:-0} -n 1 echo 2>/dev/null >/dev/null && USE_XARGS=1 echo | xargs -P ${cpus:-0} -n 1 echo 2>/dev/null >/dev/null && USE_XARGS=1
fi
fi fi
if [ "$USE_XARGS" = "0" ]; then if [ "$USE_XARGS" = "0" ]; then
test "$MAKEFLAGS" == "" && test "$cpus" != "" && export MAKEFLAGS="-j $cpus" test "$MAKEFLAGS" == "" && test "$cpus" != "" && export MAKEFLAGS="-j $cpus"
build_all_targets() build_targets()
{ {
for MAINBOARD in $( get_mainboards ); do local targets=${*-$(get_mainboards)}
build_target $MAINBOARD for MAINBOARD in $targets; do
build_target ${MAINBOARD}
remove_target ${MAINBOARD} remove_target ${MAINBOARD}
done done
} }
else else
build_all_targets() build_targets()
{ {
local targets=${*-$(get_mainboards)}
# seed shared utils # seed shared utils
TMPCFG=`mktemp` TMPCFG=`mktemp`
printf "$configoptions" > $TMPCFG printf "$configoptions" > $TMPCFG
@ -613,7 +613,7 @@ build_all_targets()
rmdir ${scanbuild_out}tmp rmdir ${scanbuild_out}tmp
fi fi
rm -rf $TARGET/temp $TMPCFG rm -rf $TARGET/temp $TMPCFG
get_mainboards | xargs -P ${cpus:-0} -n 1 $0 $cmdline -t echo $targets | xargs -P ${cpus:-0} -n 1 $0 $cmdline -t
} }
fi fi
@ -632,7 +632,9 @@ if [ "$target" != "" ]; then
exit 1 exit 1
fi fi
build_srcdir=$(mainboard_directory ${MAINBOARD}) build_srcdir=$(mainboard_directory ${MAINBOARD})
if [ ! -r $ROOT/src/mainboard/${build_srcdir} ]; then if [ "$(echo ${MAINBOARD} | wc -w)" -gt 1 ]; then
build_targets ${MAINBOARD}
elif [ ! -r $ROOT/src/mainboard/${build_srcdir} ]; then
printf "No such target: ${MAINBOARD}\n" printf "No such target: ${MAINBOARD}\n"
exit 1 exit 1
else else
@ -644,7 +646,7 @@ if [ "$target" != "" ]; then
XMLFILE=$REAL_XMLFILE XMLFILE=$REAL_XMLFILE
fi fi
else else
build_all_targets build_targets
rm -f $REAL_XMLFILE rm -f $REAL_XMLFILE
XMLFILE=$REAL_XMLFILE XMLFILE=$REAL_XMLFILE
junit '<?xml version="1.0" encoding="utf-8"?>' junit '<?xml version="1.0" encoding="utf-8"?>'