diff mbox series

[3/3] utils/brmake: allow override of MAKE

Message ID 20240713144316.403640-3-arnout@mind.be
State New
Headers show
Series [1/3] utils/docker-run: allow to specify extra mount points to propagate | expand

Commit Message

Arnout Vandecappelle July 13, 2024, 2:43 p.m. UTC
Allow to override the 'make' program to use by setting the environment
variable MAKE (which is the standard environment variable used by make
itself).

This makes it possible to use an alternative make binary, or to provide
a wrapper around make. For example, to run the build itself under
docker, you can use:

    MAKE='utils/docker-run make' utils/brmake ...

(Running brmake itself under docker isn't possible because our image
doesn't have unbuffer.)

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
---
 utils/brmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utils/brmake b/utils/brmake
index 70dfb6cdc8..06977cc18d 100755
--- a/utils/brmake
+++ b/utils/brmake
@@ -2,6 +2,8 @@ 
 # (C) 2016, "Yann E. MORIN" <yann.morin.1998@free.fr>
 # License: WTFPL, https://spdx.org/licenses/WTFPL.html
 
+MAKE="${MAKE:-make}"
+
 main() {
     local ret start d h m mf
 
@@ -12,7 +14,9 @@  main() {
 
     start=${SECONDS}
 
-    ( exec 2>&1; unbuffer make "${@}"; ) \
+    # We want word splitting of ${MAKE}
+    # shellcheck disable=SC2086
+    ( exec 2>&1; unbuffer ${MAKE} "${@}"; ) \
     > >( while read -r line; do
              printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}"
          done \