diff --git a/make/common.mk b/make/common.mk index 7cfb509e..4ad785b3 100644 --- a/make/common.mk +++ b/make/common.mk @@ -7,6 +7,9 @@ COMMON_MK_INCLUDED = true Q ?= @ INTERACTIVE ?= auto +ifndef WHICH + WHICH := command -v +endif BROWSER ?= xdg-open JWB_SCRIPT_DIR ?= $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin) jwb-script-dir-not-found) diff --git a/make/defs.mk b/make/defs.mk index 78f856ca..277fc2de 100644 --- a/make/defs.mk +++ b/make/defs.mk @@ -11,9 +11,6 @@ include $(JWBDIR)/make/projects.mk # ----- Executables -ifndef WHICH - WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which)) -endif ifndef GREP GREP := $(shell $(WHICH) grep) endif diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 09b60335..9d8a5f50 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -115,7 +115,7 @@ endif EDITOR ?= xdg-open ifeq ($(TIME),) - TIME := $(shell which time) + TIME := $(shell $(WHICH) time) ifneq ($(TIME),) TIME += -p endif diff --git a/make/py-check.mk b/make/py-check.mk index 35e5fc30..4970e792 100644 --- a/make/py-check.mk +++ b/make/py-check.mk @@ -23,7 +23,7 @@ ifndef PY_CHECK_MYPY endif ifndef PY_CHECK_RUFF - PY_CHECK_RUFF := $(shell which ruff 2>/dev/null) + PY_CHECK_RUFF := $(shell $(WHICH) ruff 2>/dev/null) ifneq ($(PY_CHECK_RUFF),) PY_CHECK_RUFF += --config $(TOPDIR)/pyproject.toml endif @@ -38,7 +38,7 @@ ifndef PY_CHECK_YAPF endif ifndef PY_CHECK_PYRIGHT - PY_CHECK_PYRIGHT := $(shell which pyright 2>/dev/null) + PY_CHECK_PYRIGHT := $(shell $(WHICH) pyright 2>/dev/null) TD_GENERATE_FILES += pyrightconfig.json endif diff --git a/make/py-version.mk b/make/py-version.mk index c705891a..3e4ec0dc 100644 --- a/make/py-version.mk +++ b/make/py-version.mk @@ -6,7 +6,7 @@ ifneq ($(PYTHON_VERSION),) else ifeq ($(PYTHON),) #PYTHON := $(lastword $(shell /bin/bash -O extglob -c "ls -v /usr/bin/python[0-9].+([0-9])")) - PYTHON := $(shell which python3 | xargs readlink -f) + PYTHON := $(shell $(WHICH) python3 | xargs readlink -f) endif PYTHON_VERSION ?= $(patsubst python%,%,$(notdir $(PYTHON))) endif