diff --git a/genctx.py b/genctx.py index 105eba435..b6c6438fa 100644 --- a/genctx.py +++ b/genctx.py @@ -25,28 +25,32 @@ def search_directories(*patterns): return it.chain.from_iterable(glob.iglob(pattern,recursive=True) for pattern in patterns) -for filename in search_directories('./src/**/*.h', './include/**/*.h'): +for filename in search_directories('./include/**/*.h'): with open(filename) as header: header_name = "/".join(filename.split('/')[2:]) - - # not needed for decomp work - if header_name.startswith("platform"): - continue if not header_name in depends_on: depends_on[header_name] = set() - if not header_name.startswith("gba/") and header_name != "global.h" and header_name != "functions.h": + if not header_name.startswith("gba/") \ + and header_name != "global.h" \ + and header_name != "functions.h": depends_on[header_name].add("global.h") - if header_name.startswith("gba/") and not header_name.endswith("types.h") and not header_name.endswith("defines.h"): + if header_name.startswith("gba/") \ + and not header_name.endswith("types.h") \ + and not header_name.endswith("defines.h"): depends_on[header_name].add("gba/types.h") - if header_name.startswith("gba/") and not header_name.endswith("multiboot.h") and not header_name.endswith("types.h"): + if header_name.startswith("gba/") \ + and not header_name.endswith("multiboot.h") \ + and not header_name.endswith("types.h"): depends_on[header_name].add("gba/multiboot.h") data[header_name] = "" for line in header.readlines(): - if "#include" in line and not line.startswith("//") and '<' not in line: + if "#include" in line \ + and not line.startswith("//") \ + and '<' not in line: requires = line.split('"')[1] depends_on[header_name].add(requires) continue @@ -58,7 +62,6 @@ def search_directories(*patterns): print_order = tuple(ts.static_order()) with open('ctx.c', 'w') as context: - context.write("#define PLATFORM_GBA 1\n") for header in print_order: exclude = False for e in excluded: