common.mk: Set WHICH to command -v #151
5 changed files with 7 additions and 7 deletions
|
|
@ -7,6 +7,9 @@ COMMON_MK_INCLUDED = true
|
||||||
|
|
||||||
Q ?= @
|
Q ?= @
|
||||||
INTERACTIVE ?= auto
|
INTERACTIVE ?= auto
|
||||||
|
ifndef WHICH
|
||||||
|
WHICH := command -v
|
||||||
|
endif
|
||||||
BROWSER ?= xdg-open
|
BROWSER ?= xdg-open
|
||||||
JWB_SCRIPT_DIR ?= $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin) jwb-script-dir-not-found)
|
JWB_SCRIPT_DIR ?= $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin) jwb-script-dir-not-found)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ include $(JWBDIR)/make/projects.mk
|
||||||
|
|
||||||
# ----- Executables
|
# ----- Executables
|
||||||
|
|
||||||
ifndef WHICH
|
|
||||||
WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which))
|
|
||||||
endif
|
|
||||||
ifndef GREP
|
ifndef GREP
|
||||||
GREP := $(shell $(WHICH) grep)
|
GREP := $(shell $(WHICH) grep)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ endif
|
||||||
|
|
||||||
EDITOR ?= xdg-open
|
EDITOR ?= xdg-open
|
||||||
ifeq ($(TIME),)
|
ifeq ($(TIME),)
|
||||||
TIME := $(shell which time)
|
TIME := $(shell $(WHICH) time)
|
||||||
ifneq ($(TIME),)
|
ifneq ($(TIME),)
|
||||||
TIME += -p
|
TIME += -p
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ ifndef PY_CHECK_MYPY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef PY_CHECK_RUFF
|
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),)
|
ifneq ($(PY_CHECK_RUFF),)
|
||||||
PY_CHECK_RUFF += --config $(TOPDIR)/pyproject.toml
|
PY_CHECK_RUFF += --config $(TOPDIR)/pyproject.toml
|
||||||
endif
|
endif
|
||||||
|
|
@ -38,7 +38,7 @@ ifndef PY_CHECK_YAPF
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef PY_CHECK_PYRIGHT
|
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
|
TD_GENERATE_FILES += pyrightconfig.json
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ ifneq ($(PYTHON_VERSION),)
|
||||||
else
|
else
|
||||||
ifeq ($(PYTHON),)
|
ifeq ($(PYTHON),)
|
||||||
#PYTHON := $(lastword $(shell /bin/bash -O extglob -c "ls -v /usr/bin/python[0-9].+([0-9])"))
|
#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
|
endif
|
||||||
PYTHON_VERSION ?= $(patsubst python%,%,$(notdir $(PYTHON)))
|
PYTHON_VERSION ?= $(patsubst python%,%,$(notdir $(PYTHON)))
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue