Update build process to use mpy-cross

This commit is contained in:
2025-07-07 15:51:37 +02:00
parent 6aa2d756c6
commit d1199575ff
4 changed files with 57 additions and 7 deletions

View File

@@ -1,6 +1,27 @@
SRC_DIR := src
BUILD_DIR := build
SRC_FILES := $(wildcard $(SRC_DIR)/*.py) $(wildcard $(SRC_DIR)/**/*.py)
BUILD_FILES := $(patsubst $(SRC_DIR)/%.py,$(BUILD_DIR)/%.mpy, $(SRC_FILES))
$(BUILD_DIR)/%.mpy: $(SRC_DIR)/%.py
@mkdir -p `dirname $@`
mpy-cross $< -o $@
.PHONY: build
build: $(BUILD_FILES)
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
.PHONY: deploy
deploy:
mpremote fs cp src/* :
deploy: $(BUILD_FILES)
mpremote fs cp -r $(BUILD_DIR)/* :
.PHONY: purge
purge:
mpremote run purge.py
.PHONY: run
run: deploy