Update build process to use mpy-cross
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user