diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2018-12-12 16:50:55 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-03-08 22:58:42 +1100 |
commit | 89ff506513d52c0c415b2cf45335d60cefac527d (patch) | |
tree | 6929b54bd0f73994ccfdb09523186b7e6b40cda6 /tools/gen-cmodules.py | |
parent | 2e516074daee76fb3e0710a893a0f40532bb3252 (diff) |
py: Update and rework build system for including external C modules.
How to use this feature is documented in docs/develop/cmodules.rst.
Diffstat (limited to 'tools/gen-cmodules.py')
-rwxr-xr-x | tools/gen-cmodules.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/tools/gen-cmodules.py b/tools/gen-cmodules.py deleted file mode 100755 index 524e3c03d..000000000 --- a/tools/gen-cmodules.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -# Generate genhdr/cmodules.h for inclusion in py/objmodule.c. - -from __future__ import print_function - -import sys -import os -from glob import glob - -def update_modules(path): - modules = [] - for module in sorted(os.listdir(path)): - if not os.path.isfile('%s/%s/micropython.mk' % (path, module)): - continue # not a module - modules.append(module) - - # Print header file for all external modules. - print('// Automatically generated by genmodules.py.\n') - for module in modules: - print('extern const struct _mp_obj_module_t %s_user_cmodule;' % module) - print('\n#define MICROPY_EXTRA_BUILTIN_MODULES \\') - for module in modules: - print(' { MP_ROM_QSTR(MP_QSTR_%s), MP_ROM_PTR(&%s_user_cmodule) }, \\' % (module, module)) - print() - -if __name__ == '__main__': - update_modules(sys.argv[1]) |