summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-10-10 23:22:29 +1100
committerDamien George <damien.p.george@gmail.com>2019-10-15 21:33:49 +1100
commit8e8cfa6f53b95fb9a7f7a430fb7bda77be56a6bd (patch)
tree2f47b16c78ad0a4ec0a56d61011747ad73e2d441 /tools
parent8f7f67123680947d7f7a38f8a2aff63c0ddd0338 (diff)
tools/make-frozen.py: Allow to run with no directory passed in.
In which case it will just emit empty frozen C definitions.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-frozen.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/make-frozen.py b/tools/make-frozen.py
index 1051b520e..8809fd0c8 100755
--- a/tools/make-frozen.py
+++ b/tools/make-frozen.py
@@ -27,14 +27,15 @@ def module_name(f):
modules = []
-root = sys.argv[1].rstrip("/")
-root_len = len(root)
+if len(sys.argv) > 1:
+ root = sys.argv[1].rstrip("/")
+ root_len = len(root)
-for dirpath, dirnames, filenames in os.walk(root):
- for f in filenames:
- fullpath = dirpath + "/" + f
- st = os.stat(fullpath)
- modules.append((fullpath[root_len + 1:], st))
+ for dirpath, dirnames, filenames in os.walk(root):
+ for f in filenames:
+ fullpath = dirpath + "/" + f
+ st = os.stat(fullpath)
+ modules.append((fullpath[root_len + 1:], st))
print("#include <stdint.h>")
print("const char mp_frozen_str_names[] = {")