From bdf33bc1367fa6fc888c791ce00b326bbd279bdf Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 8 Nov 2016 14:28:30 +1100 Subject: 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. --- py/py.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'py/py.mk') 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) -- cgit v1.2.3