update handling of [g]make

This commit is contained in:
Brett Jia 2025-02-08 12:20:17 -05:00 committed by GitHub
parent ae1aea0796
commit 161ec3ffb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,22 +22,20 @@ _nproc() {
esac esac
} }
which_make() {
case $(uname -s) in
Darwin) echo gmake ;;
*) echo make ;;
esac
}
TMPDIR=${TMPDIR:-/tmp} TMPDIR=${TMPDIR:-/tmp}
OUTDIR=${1:-cosmocc} OUTDIR=${1:-cosmocc}
APELINK=o/$(mode)/tool/build/apelink APELINK=o/$(mode)/tool/build/apelink
AMD64=${2:-x86_64} AMD64=${2:-x86_64}
ARM64=${3:-aarch64} ARM64=${3:-aarch64}
NPROC=$(($(_nproc)/2)) NPROC=$(($(_nproc)/2))
GCCVER=14.1.0 GCCVER=14.1.0
MAKE=$(which_make)
if ! MAKE=$(command -v gmake); then
if ! MAKE=$(command -v make); then
echo please install gnu make >&2
exit 1
fi
fi
$MAKE -j$NPROC m= \ $MAKE -j$NPROC m= \
$APELINK $APELINK