abuild: change compile_target interface

It only takes a single argument now, which is the directory below the
coreboot-builds directory. Preparation for future work.

The only visible change is in console output.

Change-Id: I4b0fe268ccfb69a0403fa5f8b23444c07843386f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/12276
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi 2015-10-30 23:49:32 +01:00 committed by Patrick Georgi
parent 35261c0d47
commit df7cee23c8
1 changed files with 9 additions and 10 deletions

View File

@ -216,43 +216,42 @@ function create_buildenv
function compile_target function compile_target
{ {
VENDOR=$1 local MAINBOARD=$1
MAINBOARD=$2
if [ "$quiet" == "false" ]; then printf " Compiling $VENDOR/$MAINBOARD image$cpuconfig...\n"; fi if [ "$quiet" == "false" ]; then printf " Compiling $MAINBOARD image$cpuconfig...\n"; fi
CURR=$( pwd ) CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s` #stime=`perl -e 'print time();' 2>/dev/null || date +%s`
build_dir=$TARGET/${VENDOR}_${MAINBOARD} build_dir=$TARGET/${MAINBOARD}
eval $BUILDPREFIX $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \ eval $BUILDPREFIX $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
&> ${build_dir}/make.log &> ${build_dir}/make.log
ret=$? ret=$?
cp .xcompile ${build_dir}/xcompile.build cp .xcompile ${build_dir}/xcompile.build
cd $TARGET/${VENDOR}_${MAINBOARD} cd $TARGET/${MAINBOARD}
etime=`perl -e 'print time();' 2>/dev/null || date +%s` etime=`perl -e 'print time();' 2>/dev/null || date +%s`
duration=$(( $etime - $stime )) duration=$(( $etime - $stime ))
junit " <testcase classname='board${testclass/#/.}' name='$VENDOR/$MAINBOARD' time='$duration' >" junit " <testcase classname='board${testclass/#/.}' name='$MAINBOARD' time='$duration' >"
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
junit "<system-out>" junit "<system-out>"
junitfile make.log junitfile make.log
junit "</system-out>" junit "</system-out>"
printf "ok\n" > compile.status printf "ok\n" > compile.status
printf "$VENDOR/$MAINBOARD built successfully. (took ${duration}s)\n" printf "$MAINBOARD built successfully. (took ${duration}s)\n"
else else
ret=1 ret=1
junit "<failure type='BuildFailed'>" junit "<failure type='BuildFailed'>"
junitfile make.log junitfile make.log
junit "</failure>" junit "</failure>"
printf "failed\n" > compile.status printf "failed\n" > compile.status
printf "$VENDOR/$MAINBOARD build FAILED after ${duration}s!\nLog excerpt:\n" printf "$MAINBOARD build FAILED after ${duration}s!\nLog excerpt:\n"
tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
failed=1 failed=1
fi fi
cd $CURR cd $CURR
if [ $clean_work = "true" ]; then if [ $clean_work = "true" ]; then
rm -rf $TARGET/${VENDOR}_${MAINBOARD} rm -rf $TARGET/${MAINBOARD}
fi fi
return $ret return $ret
} }
@ -305,7 +304,7 @@ function build_target
rm -rf ${scanbuild_out} rm -rf ${scanbuild_out}
BUILDPREFIX="scan-build -o ${scanbuild_out}tmp" BUILDPREFIX="scan-build -o ${scanbuild_out}tmp"
fi fi
compile_target $VENDOR $MAINBOARD compile_target ${VENDOR}_${MAINBOARD}
if [ "$scanbuild" = "true" ]; then if [ "$scanbuild" = "true" ]; then
mv ${scanbuild_out}tmp/* ${scanbuild_out} mv ${scanbuild_out}tmp/* ${scanbuild_out}
rmdir ${scanbuild_out}tmp rmdir ${scanbuild_out}tmp