diff options
author | Patrick Georgi <pgeorgi@google.com> | 2019-08-28 16:56:16 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-08-28 16:30:00 +0000 |
commit | 93bcebcfff5e40dde630d80cdf3efd9b7a2f5c10 (patch) | |
tree | 1ac043711e7e980a23ec6d9fa97ff5d35289187c /util | |
parent | e34c80256e184ca8886558dc7cc2ec4c4b37d31b (diff) | |
download | coreboot-93bcebcfff5e40dde630d80cdf3efd9b7a2f5c10.tar.xz |
abuild: Add -Z / --clean-somewhat option
This option removes everything in the build tree but coreboot.rom,
config.build, config.h and make.log - a useful subset of the tree for
further testing.
Change-Id: I27e559d8d7dc90d8fe5c4ed8e25249e202e5da36
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35136
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-x | util/abuild/abuild | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild index ef4e46b8ed..4a62cfa045 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -398,6 +398,10 @@ function compile_target if [ "$clean_work" = "true" ]; then rm -rf "${build_dir}" fi + if [ "$clean_objs" = "true" ]; then + find ${build_dir} \! \( -name coreboot.rom -o -name config.h -o -name config.build -o -name make.log \) -type f -exec rm {} + + find ${build_dir} -type d -exec rmdir -p {} + 2>/dev/null + fi return $MAKE_FAILED } @@ -595,6 +599,7 @@ Options:\n" (defaults to $XMLFILE) [-y|--ccache] Use ccache [-z|--clean] Remove build results when finished + [-Z|--clean-somewhat] Remove build but keep coreboot.rom + config [-V|--version] Print version number and exit [-h|--help] Print this help and exit @@ -641,12 +646,12 @@ getoptbrand="$(getopt -V)" # shellcheck disable=SC2086 if [ "${getoptbrand:0:6}" == "getopt" ]; then # Detected GNU getopt that supports long options. - args=$(getopt -l version,verbose,quiet,help,all,target:,board-variant:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,any-toolchain,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode,asserts -o Vvqhat:b:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie -- "$@") || exit 1 + args=$(getopt -l version,verbose,quiet,help,all,target:,board-variant:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,any-toolchain,clean,clean-somewhat,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode,asserts -o Vvqhat:b:p:c:sJCl:rP:uyBLAzZo:xX:K:d:R:Ie -- "$@") || exit 1 eval set -- $args retval=$? else # Detected non-GNU getopt - args=$(getopt Vvqhat:b:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie "$@") + args=$(getopt Vvqhat:b:p:c:sJCl:rP:uyBLAZzo:xX:K:d:R:Ie "$@") set -- $args retval=$? fi @@ -658,6 +663,7 @@ fi chromeos=false clean_work=false +clean_objs=false verboseopt='V=0' customizing="" configoptions="" @@ -730,6 +736,10 @@ while true ; do customizing="${customizing}, clean" clean_work=true ;; + -Z|--clean-somewhat) shift + customizing="${customizing}, clean-somewhat" + clean_objs=true + ;; -o|--outdir) shift TARGET=$1; shift ;; |