diff options
author | Leah Rowe <leah@libreboot.org> | 2024-07-06 04:29:03 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-07-06 11:34:19 +0100 |
commit | 87df6ae36957703e57eb9c5a12399289deb797fe (patch) | |
tree | 30877602e7dc76475d4205bb8489887b54054487 /script/trees | |
parent | 23ca49bee846cee6b23f87bfb4d3ee07798c337a (diff) |
trees: support build dependencies, not just fetch
We already have this to an extent, e.g. the xtree variable.
The xtree variable could probably be removed, in favour of
this, and used for the same purpose.
It works like this, for example:
build_depend="coreboot/default grub/xhci seabios u-boot/gru_bob flashprog"
the "/" denotes a tree, if it's a multi-tree project. However, specifying
the entire multi-tree project without slash is possible, for example:
build_depend="coreboot"
this would specify that all coreboot trees must be built.
This functionality will be used in follow-up commits, centralising
script/trees into mk on the main directory, repacing "build".
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/trees')
-rwxr-xr-x | script/trees | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/script/trees b/script/trees index cf344d9d..aa32cfa3 100755 --- a/script/trees +++ b/script/trees @@ -11,7 +11,7 @@ set -u -e eval `setvars "" xarch cdir defconfig cmakedir xlang mode makeargs elfdir cmd \ project target target_dir targets xtree _f target1 bootstrapargs mkhelper \ - autoconfargs listfile autogenargs btype tree rev tree_depend` + autoconfargs listfile autogenargs btype tree rev tree_depend build_depend` main() { @@ -142,7 +142,7 @@ handle_src_tree() load_target_config() { eval `setvars "" xarch xlang bootstrapargs autoconfargs xtree \ - tree_depend makeargs btype mkhelper` + tree_depend makeargs btype mkhelper build_depend` [ -f "$1/target.cfg" ] || btype="auto" [ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"` @@ -161,6 +161,14 @@ load_target_config() [ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1 + [ -z "$mode" ] && for bd in $build_depend; do + bd_project="${bd%%/*}"; bd_tree="${bd##*/}" + [ -z "$bd_project" ] && $err "$project/$tree: bad bd: '$bd'" + [ "${bd##*/}" = "$bd" ] && bd_tree="" + [ -z "$bd_project" ] || ./update trees -b $bd_project \ + $bd_tree || $err "$project/$tree: !bd $bd"; continue + done + [ "$mode" = "fetch" ] || return 0 [ -f "CHANGELOG" ] && return 1; fetch_${cmd#build_}; return 1 } |