aboutsummaryrefslogtreecommitdiff
path: root/py/py.mk
diff options
context:
space:
mode:
authorDamien George2016-11-08 14:28:30 +1100
committerDamien George2016-11-08 14:28:30 +1100
commitbdf33bc1367fa6fc888c791ce00b326bbd279bdf (patch)
treebb3f5ab0c7912305fb8f61c03fa478ecc815880c /py/py.mk
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 'py/py.mk')
-rw-r--r--py/py.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/py.mk b/py/py.mk
index 767fcac52..c71ab7a0c 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -237,10 +237,16 @@ PY_O_BASENAME = \
# prepend the build destination prefix to the py object files
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
+# object file for frozen files
ifneq ($(FROZEN_DIR),)
PY_O += $(BUILD)/$(BUILD)/frozen.o
endif
+# object file for frozen bytecode (frozen .mpy files)
+ifneq ($(FROZEN_MPY_DIR),)
+PY_O += $(BUILD)/$(BUILD)/frozen_mpy.o
+endif
+
# Sources that may contain qstrings
SRC_QSTR_IGNORE = nlr% emitnx% emitnthumb% emitnarm%
SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_O_BASENAME:.o=.c)) emitnative.c)