summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-10-17 13:29:56 +0100
committerLeah Rowe <leah@libreboot.org>2025-10-17 13:29:56 +0100
commit96f786b962e2a933ddf69cd74f8b2635f7b142b1 (patch)
tree3040df19832f441f6b7379506bac76b2ea26c092
parent47f08e2e6df999bd12526fb755f50f4aed8e560d (diff)
tree.sh: convert do_make into a macro
use it similarly to if_dry_build/if_not_dry_build there is nothing cooler than an sh macro : Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/tree.sh26
1 files changed, 12 insertions, 14 deletions
diff --git a/include/tree.sh b/include/tree.sh
index 450d79cf..a395caf9 100644
--- a/include/tree.sh
+++ b/include/tree.sh
@@ -10,6 +10,8 @@ flag=""
# macros, overridden depending on the flag
if_dry_build=":"
if_not_dry_build=""
+if_do_make=""
+if_not_do_make=":"
autoconfargs=""
autogenargs=""
@@ -23,7 +25,6 @@ cmakedir=""
cmd=""
defconfig=""
dest_dir=""
-do_make=""
elfdir=""
forcepull=""
gccdir=""
@@ -84,12 +85,16 @@ trees()
-c) mode="distclean" ;;
-x) mode="crossgcc-clean" ;;
-f) # download source code for a project
- do_make="n" # lets us know not to build anything
+ # macros. colon means false.
+ if_do_make=":"
+ if_not_do_make=""
if_not_dry_build=":"
if_dry_build=""
;;
-F) # same as -F, but don't skip git fetch/pull on cache
- do_make="n" # lets us know not to build anything
+ # macros. colon means false
+ if_do_make=":"
+ if_not_do_make=""
if_not_dry_build=":"
if_dry_build=""
forcepull="y"
@@ -319,12 +324,8 @@ configure_project()
break
fi
- if [ "$do_make" != "n" ]; then
- # if we're *downloading* a project, then
- # we don't need to to change the target.cfg
-
+ $if_do_make \
break
- fi
if [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ]
then
# we have found the main source tree that
@@ -356,14 +357,11 @@ configure_project()
if [ ! -f "CHANGELOG" ]; then
delete_old_project_files
- fi
- if [ "$do_make" = "n" ]; then
- if [ ! -f "CHANGELOG" ]; then
+ $if_not_do_make \
fetch_${cmd#build_}
- fi
-
- return 1
fi
+ $if_not_do_make \
+ return 1
x_ ./mk -f "$project" "$target"
}