Commit 733db525 authored by Damien George's avatar Damien George
Browse files

stmhal: Add Makefile option FROZEN_MPY_DIR to support frozen bytecode.

parent f9448ddc
......@@ -279,6 +279,28 @@ $(BUILD)/frozen-files.c: $(shell find $(FROZEN_DIR) -type f)
ifneq ($(FROZEN_MPY_DIR),)
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
FROZEN_MPY_FILES := $(wildcard $(FROZEN_MPY_DIR)/*.py)
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
OBJ += $(BUILD)/$(FROZEN_MPY_DIR)/frozen_mpy.o
MPY_CROSS = ../mpy-cross/mpy-cross
MPY_TOOL = ../tools/
@$(ECHO) "MPY $<"
$(Q)$(MPY_CROSS) -o $@ $^
$(BUILD)/$(FROZEN_MPY_DIR)/frozen_mpy.c: $(addprefix $(BUILD)/,$(
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $^ > $@
$(BUILD)/$(FROZEN_MPY_DIR)/frozen_mpy.o: $(BUILD)/$(FROZEN_MPY_DIR)/frozen_mpy.c
$(call compile_c)
.PHONY: deploy
deploy: $(BUILD)/firmware.dfu
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment