summaryrefslogtreecommitdiff
path: root/resources/scripts/build/module/cbutils
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-06-24 23:23:16 +0100
committerLeah Rowe <leah@libreboot.org>2023-06-24 23:23:16 +0100
commit941fbcbf1b070c5e82c8590e6a4f1afcc0da78a4 (patch)
tree6cdbfaaab4b1f684e0fe75674f69c0a9eb4e8251 /resources/scripts/build/module/cbutils
parent4a49ea3599c8610984c41ef6a234556ed9d0bce5 (diff)
run coreboot utils from own directory
this means coreboot can now be distcleaned safely, before and after each build of a rom image Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/build/module/cbutils')
-rwxr-xr-xresources/scripts/build/module/cbutils15
1 files changed, 11 insertions, 4 deletions
diff --git a/resources/scripts/build/module/cbutils b/resources/scripts/build/module/cbutils
index ee6e8692..8d4e2f2f 100755
--- a/resources/scripts/build/module/cbutils
+++ b/resources/scripts/build/module/cbutils
@@ -59,10 +59,17 @@ buildutils() {
./download coreboot $cbtree || return 1
fi
for util in cbfstool ifdtool; do
- utildir="coreboot/${cbtree}/util/${util}/"
- make distclean -C "${utildir}"
- make -j$(nproc) -C "${utildir}" \
- || return 1
+ [ -f "cbutils/${cbtree}/${util}" ] \
+ && continue
+ if [ ! -d "cbutils/${cbtree}" ]; then
+ mkdir -p "cbutils/${cbtree}" || return 1
+ fi
+
+ utildir="coreboot/${cbtree}/util/${util}"
+ make distclean -C "${utildir}" || return 1
+ make -j$(nproc) -C "${utildir}" || return 1
+ mv "${utildir}/${util}" "cbutils/${cbtree}" || return 1
+ make distclean -C "${utildir}" || return 1
done
}