diff options
| author | Damien George <damien@micropython.org> | 2023-06-06 14:24:41 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-06-08 23:12:56 +1000 |
| commit | f01d5fb657159f1afa9d41cf39830d17b791a67e (patch) | |
| tree | ab42b7cb0f68ae537954579a72a69b78aa66ce3f /py | |
| parent | 30100e9b3d4e2b805997a642e5e411aaf14324a7 (diff) | |
py/mkrules.mk: Automatically configure frozen options when manifest set.
Following how mkrules.cmake works. This makes it easy for a port to enable
frozen code, by defining FROZEN_MANIFEST in its Makefile.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
| -rw-r--r-- | py/mkrules.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk index aa7f77bd2..db81faa7f 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -183,6 +183,11 @@ ifeq ($(MPY_LIB_DIR),$(MPY_LIB_SUBMODULE_DIR)) GIT_SUBMODULES += lib/micropython-lib endif +# Set compile options needed to enable frozen code. +CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool +CFLAGS += -DMICROPY_MODULE_FROZEN_MPY +CFLAGS += -DMICROPY_MODULE_FROZEN_STR + # to build frozen_content.c from a manifest $(BUILD)/frozen_content.c: FORCE $(BUILD)/genhdr/qstrdefs.generated.h $(BUILD)/genhdr/root_pointers.h | $(MICROPY_MPYCROSS_DEPENDENCY) $(Q)test -e "$(MPY_LIB_DIR)/README.md" || (echo -e $(HELP_MPY_LIB_SUBMODULE); false) |
