summaryrefslogtreecommitdiff
path: root/util/abuild
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2014-05-21 22:47:05 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2014-05-23 08:35:28 +0200
commitb0bc63b519d05cdf4b3aedaa683de09f410e9785 (patch)
tree3e900fbb4116ac7d797c17c1bc72db4643f7723f /util/abuild
parent1f946706f119a7ec974170926165793f6f9ddd12 (diff)
abuild: allow deleting the work directories immediately
This is useful on pure build nodes that don't care for object files, just for a build log and success flag. Change-Id: Ida65d4e41652af0f1b7255309aec2eeb6ef5c9ef Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/5804 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/abuild')
-rwxr-xr-xutil/abuild/abuild18
1 files changed, 13 insertions, 5 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 85b6406ef8..6c8c304984 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -254,18 +254,20 @@ function compile_target
junit "</system-out>"
printf "ok\n" > compile.status
printf "ok. (took ${duration}s)\n"
- cd $CURR
- return 0
else
+ ret=1
junit "<failure type='BuildFailed'>"
junitfile make.log
junit "</failure>"
printf "FAILED after ${duration}s!\nLog excerpt:\n"
tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
- cd $CURR
failed=1
- return 1
fi
+ cd $CURR
+ if [ $clean_work = "true" ]; then
+ rm -rf $TARGET/${VENDOR}_${MAINBOARD}
+ fi
+ return $ret
}
function build_target
@@ -395,6 +397,7 @@ function myhelp
printf " [-u|--update] update existing image\n"
printf " [-P|--prefix <name>] file name prefix in CBFS\n"
printf " [-B|--blobs] Allow using binary files\n"
+ printf " [-z|--clean] Remove build results when finished\n"
printf " [-L|--clang] Use clang\n"
printf " [--scan-build] use clang's static analyzer\n"
printf " [cbroot] absolute path to coreboot sources\n"
@@ -437,7 +440,7 @@ cmdline="$* -c 1"
getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang -o Vvhat:p:Tc:sJCl:rP:uyBL -- "$@"` || exit 1
+ args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean -o Vvhat:p:Tc:sJCl:rP:uyBLz -- "$@"` || exit 1
eval set -- $args
else
# Detected non-GNU getopt
@@ -450,6 +453,7 @@ if [ $? != 0 ]; then
exit 1
fi
+clean_work=false
customizing=""
configoptions=""
while true ; do
@@ -501,6 +505,10 @@ while true ; do
customizing="${customizing}, clang"
configoptions="${configoptions}CONFIG_COMPILER_LLVM_CLANG=y\n"
;;
+ -z|--clean) shift
+ customizing="${customizing}, clean"
+ clean_work=true
+ ;;
--) shift; break;;
-*) printf "Invalid option\n\n"; myhelp; exit 1;;
*) break;;