Detect Python executable in Makefile

`make help` failed on modern platforms that have only
python3 executable installed.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
This commit is contained in:
Sorin Sbarnea
2019-11-27 19:26:56 +00:00
parent 7605387a70
commit 7262e545c8

View File

@ -32,6 +32,7 @@ BUILDTAGS ?= \
exclude_graphdriver_devicemapper \
seccomp \
varlink
PYTHON ?= $(shell command -v python python3)
GO_BUILD=$(GO) build
# Go module support: set `-mod=vendor` to use the vendored sources
@ -133,7 +134,7 @@ endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
@$(PYTHON) -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
.gopathok:
ifeq ("$(wildcard $(GOPKGDIR))","")