summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-09-15 21:11:51 +0100
committerLeah Rowe <leah@libreboot.org>2026-09-15 21:11:51 +0100
commit6a5b4c98d631a90d81f859afa6b7ad0e67d9aeb0 (patch)
tree66b9a886b24c54528fbae4d9a938ad1f5bcb3cff
parent50eec6d485bd1307cfd2c4ab3a172f50c430d95d (diff)
mk: clean up getopt flags
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xmk26
1 files changed, 10 insertions, 16 deletions
diff --git a/mk b/mk
index 52497639..08e6643a 100755
--- a/mk
+++ b/mk
@@ -85,7 +85,7 @@ eval "`newvar autoconfargs autogenargs badhash badtghash bootstrapargs \
main()
{
- flags="f:F:b:m:u:c:x:s:l:n:d:"
+ flags="f:F:b:m:u:s:l:n:d:"
while getopts $flags option
do
@@ -98,28 +98,19 @@ main()
# ./mk -m coreboot does: make menuconfig -C src/coreboot/tree
case "$flag" in
- -d)
- # -d is similar to -b, except that
- # a large number of operations will be
- # skipped. these are "if_not_dry_build build" scenarios
- # where only a subset of build tasks are done,
- # and $if_not_dry_build is prefixed to skipped commands
-
+ -b) : ;; # build a source tree
+ -d) # dry builds. -d is like -b but skips many build steps
if_dry_build=""
if_not_dry_build=":"
;;
- -b) : ;;
- -u) mode="oldconfig" ;;
- -m) mode="menuconfig" ;;
-f|-F) # download source code for a project
- # macros. colon means false.
- if_do_make=":"
if_dry_build=""
- if_not_do_make=""
if_not_dry_build=":"
[ "$flag" = "-F" ] && \
forcepull="y"; : # never skip git fetch/pull
;;
+ -u) mode="oldconfig" ;;
+ -m) mode="menuconfig" ;;
-s) mode="savedefconfig" ;;
-l) mode="olddefconfig" ;;
-n) mode="nconfig" ;;
@@ -130,11 +121,14 @@ main()
if_build=""
if_not_build=":"
fi
-
if [ "${mode%config}" != "$mode" ]; then
if_make_config=""
if_not_make_config=":"
fi
+ if [ "$flag" = "-F" ] || [ "$flag" = "-f" ]; then
+ if_do_make=":"
+ if_not_do_make=""
+ fi
if [ -z "${OPTARG+x}" ]; then
shift 1
@@ -533,7 +527,7 @@ run_make_command()
x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
- ) || err "run_make_file" "$@"
+ ) || err "run_make_command" "$@"
$if_build \
x_ $mkhelper; :