From 678dbd26f88928c403d6e55215bd3f560da649fb Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Tue, 30 Dec 2025 21:17:41 +0100 Subject: [PATCH] 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 --- ports/alif/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/alif/Makefile b/ports/alif/Makefile index d258b27b1d..5eff6ccd9a 100644 --- a/ports/alif/Makefile +++ b/ports/alif/Makefile @@ -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)