mmake gets smarter about locating make

- Check `$COSMOCC`, defaulting to `/opt/cosmocc`.

- Try to get the full path of the repo `make.com`. I'm not aware of
  a way of getting the path that defines a zsh function, so the best
  fallback available is `$PWD`.
This commit is contained in:
Jōshin 2024-01-01 23:34:35 -05:00
parent 307823ae00
commit 2902b76168
No known key found for this signature in database

View file

@ -38,7 +38,7 @@ done
whence nproc >/dev/null || autoload -Uz nproc
j=-j$(nproc)
}
local make=${MAKE:-$(echo /opt/cosmocc/bin/make(X) 2>/dev/null)}
[[ -z $make ]] && make=build/bootstrap/make.com
local make=${MAKE:-${COSMOCC:-/opt/cosmocc}/bin/make}
[[ -x $make ]] || make=${COSMO:-$PWD}/build/bootstrap/make.com
( set -x
exec $make $j $flags MODE=$mode $targs )