Define PYTHON in library/Makefile

Copy the definition from tests/Makefile and programs/Makefile: default to
`python3` on Unix-like platforms where `python3` exists and to `python`
otherwise.

This is necessary on Unix-like platforms where python3 doesn't exist and on
Windows platforms where neither the shebang nor the extension works to run a
Python script.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2021-11-22 11:02:10 +01:00
parent e963a0e388
commit 30d9a37339

View File

@@ -23,6 +23,11 @@ endif
# CFLAGS += -D_BSD_EXTENSION
PERL ?= perl
ifdef WINDOWS
PYTHON ?= python
else
PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi)
endif
# if were running on Windows build for Windows
ifdef WINDOWS