Improve mpy-cross compilation target
This commit is contained in:
parent
08c255b6e4
commit
317f6407d6
18
Makefile
18
Makefile
@ -30,19 +30,19 @@ TIMESTAMP := $(shell date +%s)
|
|||||||
|
|
||||||
all: copy-kmk copy-bootpy copy-keymap copy-board
|
all: copy-kmk copy-bootpy copy-keymap copy-board
|
||||||
|
|
||||||
compile: $(MPY_TARGET_DIR)/.mpy.compiled
|
.PHONY: compile compile-check
|
||||||
|
compile: compile-check
|
||||||
$(MPY_TARGET_DIR)/.mpy.compiled: $(PY_KMK_TREE)
|
|
||||||
ifeq ($(MPY_CROSS),)
|
ifeq ($(MPY_CROSS),)
|
||||||
|
compile-check:
|
||||||
@echo "===> Could not find mpy-cross in PATH, exiting"
|
@echo "===> Could not find mpy-cross in PATH, exiting"
|
||||||
@false
|
@false
|
||||||
endif
|
else
|
||||||
|
compile-check: $(PY_KMK_TREE:%.py=$(MPY_TARGET_DIR)/%.mpy)
|
||||||
@echo "===> Compiling all py files to mpy with flags $(MPY_FLAGS)"
|
@echo "===> Compiling all py files to mpy with flags $(MPY_FLAGS)"
|
||||||
@mkdir -p $(MPY_TARGET_DIR)
|
$(MPY_TARGET_DIR)/%.mpy: %.py
|
||||||
@echo "KMK_RELEASE = '$(DIST_DESCRIBE)'" > $(MPY_SOURCES)/release_info.py
|
@mkdir -p $(dir $@)
|
||||||
@find $(MPY_SOURCES) -name "*.py" -exec sh -c 'mkdir -p $(MPY_TARGET_DIR)/$$(dirname {}) && $(MPY_CROSS) $(MPY_FLAGS) {} -o $(MPY_TARGET_DIR)/$$(dirname {})/$$(basename -s .py {}).mpy' \;
|
@$(MPY_CROSS) $(MPY_FLAGS) $? -o $@
|
||||||
@rm -rf $(MPY_SOURCES)/release_info.py
|
endif
|
||||||
@touch $(MPY_TARGET_DIR)/.mpy.compiled
|
|
||||||
|
|
||||||
.devdeps: Pipfile.lock
|
.devdeps: Pipfile.lock
|
||||||
@echo "===> Installing dependencies with pipenv"
|
@echo "===> Installing dependencies with pipenv"
|
||||||
|
Loading…
Reference in New Issue
Block a user