From 60813003a3d32819f954b0ce306cd385d3b8036f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 19:22:17 -0500 Subject: [PATCH] tool/zsh/mmake cleanup - collects all flags into their own array to support `mmake $target -j8` - prints out the raw make invocation to be run --- tool/zsh/mmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/zsh/mmake b/tool/zsh/mmake index 6a7dcfc10..78418f1d5 100644 --- a/tool/zsh/mmake +++ b/tool/zsh/mmake @@ -21,14 +21,16 @@ esac arm64|aarch64) mode=aarch64 ;; esac } +local -a targs local -a flags while (( $# > 0 )); do case $1 in -*|*=*) flags+=($1); shift ;; - *) break ;; + *) targs+=($1); shift ;; esac done local make [[ -x /opt/cosmocc/bin/make ]] && make=/opt/cosmocc/bin/make [[ -z $make ]] && make=build/bootstrap/make.com -$make $flags MODE=$mode ${(@)@/#/o/$mode/} +( set -x + exec $make $flags MODE=$mode ${(@)targs/#/o/$mode/} )