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 ?= @
|
||||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ endif
|
|||
|
||||
EDITOR ?= xdg-open
|
||||
ifeq ($(TIME),)
|
||||
TIME := $(shell which time)
|
||||
TIME := $(shell $(WHICH) time)
|
||||
ifneq ($(TIME),)
|
||||
TIME += -p
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue