tools/mpy-tool.py: List frozen modules in MICROPY_FROZEN_LIST_ITEM.
@@ -916,6 +916,17 @@ def freeze_mpy(base_qstrs, raw_codes):
print(" &raw_code_%s," % rc.escaped_name)
print("};")
+ # If a port defines MICROPY_FROZEN_LIST_ITEM then list all modules wrapped in that macro.
+ print("#ifdef MICROPY_FROZEN_LIST_ITEM")
+ for rc in raw_codes:
+ module_name = rc.source_file.str
+ if module_name.endswith("/__init__.py"):
+ short_name = module_name[: -len("/__init__.py")]
+ else:
+ short_name = module_name[: -len(".py")]
+ print('MICROPY_FROZEN_LIST_ITEM("%s", "%s")' % (short_name, module_name))
+ print("#endif")
+
def merge_mpy(raw_codes, output_file):
assert len(raw_codes) <= 31 # so var-uints all fit in 1 byte
