build/clean/crossgcc: better code style

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-05-20 18:28:17 +01:00
parent 187d5fa418
commit 4b80f250fb
+18 -16
View File
@@ -2,7 +2,7 @@
# helper script: clean the crossgcc builds
#
# Copyright (C) 2014, 2015, 2016, 2020 Leah Rowe <info@minifree.org>
# Copyright (C) 2014-2016, 2020, 2023 Leah Rowe <info@minifree.org>
# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -19,26 +19,28 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This script assumes that the current working directory is the root
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
# clean coreboot utilities (dependencies for 'build'):
main()
{
printf "Cleaning crossgcc builds in all coreboot archives\n"
printf "Cleaning crossgcc builds in all coreboot archives\n"
[ ! -d "coreboot/" ] && exit 0
[ ! -d "coreboot/" ] && exit 0
# clean coreboot and crossgcc (source archives preserved)
for board in coreboot/*; do
if [ "${board##*/}" = "coreboot" ]; then
for board in coreboot/*; do
[ "${board##*/}" = "coreboot" ] && \
continue
fi
if [ ! -d "${board}" ]; then
[ ! -d "${board}" ] && \
continue
fi
make -C "${board}/" crossgcc-clean
done
make -C "${board}/" crossgcc-clean || err "make-clean"
done
}
printf "\n\n"
err()
{
printf "%s: %s\n" $0 $1
exit 1
}
main $@