summaryrefslogtreecommitdiff
path: root/unix
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-11-08 14:28:30 +1100
committerDamien George <damien.p.george@gmail.com>2016-11-08 14:28:30 +1100
commitbdf33bc1367fa6fc888c791ce00b326bbd279bdf (patch)
treebb3f5ab0c7912305fb8f61c03fa478ecc815880c /unix
parent5630778f0f3a114f5b7d7f71f3df0bd1c3b378f6 (diff)
py: Move frozen bytecode Makefile rules from ports to common mk files.
Now, to use frozen bytecode all a port needs to do is define FROZEN_MPY_DIR to the directory containing the .py files to freeze, and define MICROPY_MODULE_FROZEN_MPY and MICROPY_QSTR_EXTRA_POOL.
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile16
1 files changed, 0 insertions, 16 deletions
diff --git a/unix/Makefile b/unix/Makefile
index a14ed215c..5e212ff70 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -175,26 +175,10 @@ SRC_QSTR_AUTO_DEPS +=
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).
-MPY_CROSS = ../mpy-cross/mpy-cross
-MPY_TOOL = ../tools/mpy-tool.py
-FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')
-FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
CFLAGS += -DMICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE=0 # not supported
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
-OBJ += $(BUILD)/$(BUILD)/frozen_mpy.o
-
-# to build .mpy files from .py files
-$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py
- @$(ECHO) "MPY $<"
- $(Q)$(MKDIR) -p $(dir $@)
- $(Q)$(MPY_CROSS) -o $@ -s $(^:$(FROZEN_MPY_DIR)/%=%) $^
-
-# to build frozen_mpy.c from all .mpy files
-$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h
- @$(ECHO) "Creating $@"
- $(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $(FROZEN_MPY_MPY_FILES) > $@
endif