From 9ba968713a34352ab4c6e5fb78c637f3f52b5a8b Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Sun, 25 Feb 2024 18:00:45 +0000 Subject: [PATCH] build: Use `command -v` in preference to `which` Signed-off-by: Andrew Cooper --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b6e0dd8..d98a4af 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ INSTALL_DIR := $(INSTALL) -d -p INSTALL_PROGRAM := $(INSTALL) -p # Best effort attempt to find a python interpreter, defaulting to Python 3 if -# available. Fall back to just `python` if `which` is nowhere to be found. -PYTHON_INTERPRETER := $(word 1,$(shell which python3 python python2 2>/dev/null) python) +# available. Fall back to just `python`. +PYTHON_INTERPRETER := $(word 1,$(shell command -v python3 || command -v python || command -v python2) python) PYTHON ?= $(PYTHON_INTERPRETER) export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON -- 2.39.5