diff options
Diffstat (limited to 'resources/scripts/build/clean/cbutils')
-rwxr-xr-x | resources/scripts/build/clean/cbutils | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/resources/scripts/build/clean/cbutils b/resources/scripts/build/clean/cbutils index dec8d944..067c2cb2 100755 --- a/resources/scripts/build/clean/cbutils +++ b/resources/scripts/build/clean/cbutils @@ -24,26 +24,36 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -# clean coreboot utilities (dependencies for 'build'): - -printf "Cleaning the previous build of coreboot and its utilities\n" - -rm -Rf cbutils - -[ ! -d "coreboot/" ] && exit 0 - -for tree in coreboot/*; do - [ "${tree##*/}" = "coreboot" ] && continue - [ -d "${tree}" ] || continue - - # Clean coreboot, of course - make -C "${tree}/" distclean - - # Clean its utilities as well - for util in cbfstool ifdtool nvramtool cbmem; do - make distclean -C "${tree}/util/${util}/" +. "include/err.sh" + +main() +{ + printf "Cleaning the previous build of coreboot and its utilities\n" + + rm -Rf cbutils || err "cannot remove cbutils/" + [ ! -d "coreboot/" ] && exit 0 + + clean_cbutils +} + +clean_cbutils() +{ + for tree in coreboot/*; do + [ "${tree##*/}" = "coreboot" ] && continue + [ -d "${tree}" ] || continue + + # Clean coreboot, of course + make -C "${tree}/" distclean || \ + err "cannot distclean coreboot tree, ${tree}" + + # Clean its utilities as well + for util in cbfstool ifdtool nvramtool cbmem; do + make distclean -C "${tree}/util/${util}/" || \ + err "cannot clean util, ${util}, at ${tree}" + done + make distclean -C "${tree}/payloads/libpayload/" || \ + err "cannot distclean libpayload, at ${tree}" done - make distclean -C "${tree}/payloads/libpayload/" -done +} -printf "\n\n" +main $@ |