summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers/build/clean
diff options
context:
space:
mode:
Diffstat (limited to 'resources/scripts/helpers/build/clean')
-rwxr-xr-xresources/scripts/helpers/build/clean/coreboot29
1 files changed, 22 insertions, 7 deletions
diff --git a/resources/scripts/helpers/build/clean/coreboot b/resources/scripts/helpers/build/clean/coreboot
index 135e194..2f7701e 100755
--- a/resources/scripts/helpers/build/clean/coreboot
+++ b/resources/scripts/helpers/build/clean/coreboot
@@ -2,7 +2,7 @@
# helper script: clean the dependencies that were built in coreboot
#
-# Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
+# Copyright (C) 2014, 2015, 2016 Francis Rowe <info@gluglug.org.uk>
# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -29,12 +29,27 @@ set -u -e
printf "Cleaning the previous build of coreboot and its utilities\n"
# clean coreboot and crossgcc (source archives preserved)
-make -C coreboot clean
-make -C coreboot crossgcc-clean
-
-# Clean its utilities as well
-for util in {cbfs,ifd,nvram}tool cbmem; do
- make -C coreboot/util/"${util}" clean
+for payload in coreboot/*; do
+ for board in "${payload}/"*; do
+ # Clean coreboot, of course
+ make -C "${board}/" distclean
+
+ # Clean its utilities as well
+ for util in {cbfs,ifd,nvram}tool cbmem; do
+ make -C "${board}/util/${util}/" clean
+ done
+ make -C "${board}/payloads/libpayload/" distclean
+
+ # Clean crossgcc
+ if [ "${payload##*/}" != "crossgcc" ]; then # is a symlink
+ # delete symlink to crossgcc
+ rm -f "${board}/util/crossgcc"
+ else # is the real crossgcc
+ # payload is crossgcc
+ # board is not a board, it's a coreboot revision
+ make -C "${board}/" crossgcc-clean
+ fi
+ done
done
printf "\n\n"