alif/Makefile: Do not hardcode the python interpreter name.

This commit fixes a build issue occurring on systems where the Python
3.x interpreter isn't aliased to 'python' but has a different name
(usually `python3').

The main Linux distribution where this occurs is Ubuntu LTS, where the
Python 3.x interpreter is available as 'python3' since at least two
major versions (so since about five years now).  MicroPython's makefile
environment setup file ('py/mkenv.mk') already defines a variable called
'$(PYTHON)' that defaults to 'python3', so the Makefile was updated to
use that instead of hardcoding the interpreter name.  Without these
changes, building a firmware image on Ubuntu LTS fails with this error:

make: python: No such file or directory
make: *** [Makefile:95: build-ALIF_ENSEMBLE/firmware.toc.bin] Error 127

This also allows overriding the interpreter name to something else if
there's the need to perform tests with different interpreter versions or
the like.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti
2025-12-30 21:17:41 +01:00
committed by Damien George
parent 3980a0c01f
commit 678dbd26f8

View File

@@ -92,7 +92,7 @@ $(BUILD)/$(ALIF_TOC_CONFIG): mcu/$(ALIF_TOC_CONFIG).in | $(BUILD)
$(Q)$(CPP) -P -E $(ALIF_TOC_CFLAGS) - < mcu/$(ALIF_TOC_CONFIG).in > $@
$(ALIF_TOC_BIN): $(ALIF_TOC_APPS)
$(Q)python $(ALIF_TOOLS)/app-gen-toc.py \
$(Q)$(PYTHON) $(ALIF_TOOLS)/app-gen-toc.py \
--filename $(abspath $(BUILD)/$(ALIF_TOC_CONFIG)) \
--output-dir $(BUILD) \
--firmware-dir $(BUILD) \
@@ -105,7 +105,7 @@ $(BUILD)/firmware.zip: $(ALIF_TOC_BIN) $(ALIF_TOC_APPS)
.PHONY: deploy
deploy: $(ALIF_TOC_BIN)
$(ECHO) "Writing $< to the board"
$(Q)python $(ALIF_TOOLS)/app-write-mram.py \
$(Q)$(PYTHON) $(ALIF_TOOLS)/app-write-mram.py \
--cfg-part $(ALIF_TOOLKIT_CFG_PART) \
--port $(PORT) \
--pad \
@@ -117,13 +117,13 @@ deploy-jlink: $(ALIF_TOC_APPS)
.PHONY: maintenance
maintenance:
$(Q)python $(ALIF_TOOLS)/maintenance.py \
$(Q)$(PYTHON) $(ALIF_TOOLS)/maintenance.py \
--cfg-part $(ALIF_TOOLKIT_CFG_PART) \
--port $(PORT)
.PHONY: update-system-package
update-system-package:
$(Q)python $(ALIF_TOOLS)/updateSystemPackage.py \
$(Q)$(PYTHON) $(ALIF_TOOLS)/updateSystemPackage.py \
--cfg-part $(ALIF_TOOLKIT_CFG_PART) \
--port $(PORT)