Skip to content

Commit 89a8757

Browse files
committed
build: Use command -v in preference to which
Signed-off-by: Andrew Cooper <[email protected]>
1 parent f37c457 commit 89a8757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ INSTALL_DIR := $(INSTALL) -d -p
5050
INSTALL_PROGRAM := $(INSTALL) -p
5151

5252
# Best effort attempt to find a python interpreter, defaulting to Python 3 if
53-
# available. Fall back to just `python` if `which` is nowhere to be found.
54-
PYTHON_INTERPRETER := $(word 1,$(shell which python3 python python2 2>/dev/null) python)
53+
# available. Fall back to just `python`.
54+
PYTHON_INTERPRETER := $(word 1,$(shell command -v python3 || command -v python || command -v python2) python)
5555
PYTHON ?= $(PYTHON_INTERPRETER)
5656

5757
export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON

0 commit comments

Comments
 (0)