From 72dfbfabd4dc890065872042c45881db4663352d Mon Sep 17 00:00:00 2001 From: Tynan McAuley Date: Thu, 12 Mar 2020 15:29:01 +0200 Subject: [PATCH] Allow user to override MAKE command used by toolchain and openocd build. On macOS, "gnumake" and "make" are both supplied by the OS, but are too old to build glibc (both are version 3.81 as of this writing). Homebrew provides the "gmake" executable, which is recent enough for glibc. However, the existing logic in "scripts/build-util.sh" will always prefer "gnumake" over "gmake". The configure logic in the riscv-glibc library allows a user to override the preference for "gnumake" by setting the MAKE environment variable. This change makes "scripts/build-openocd.sh" and "scripts/build-toolchains.sh" mimic that behavior. A user can now use "gmake" instead of "gnumake" during the toolchain build like so: MAKE=gmake ./scripts/build-toolchains.sh --- scripts/build-util.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-util.sh b/scripts/build-util.sh index be58a6a1..10a7cb7b 100644 --- a/scripts/build-util.sh +++ b/scripts/build-util.sh @@ -14,7 +14,8 @@ case ${ncpu} in *) export MAKEFLAGS="-j ${ncpu} ${MAKEFLAGS}" ;; esac -MAKE=$(command -v gnumake || command -v gmake || command -v make) +# Allow user to override MAKE +[ -n "${MAKE}" ] || MAKE=$(command -v gnumake || command -v gmake || command -v make) readonly MAKE