diff options
Diffstat (limited to 'pokemontools/scan_includes.py')
-rw-r--r-- | pokemontools/scan_includes.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pokemontools/scan_includes.py b/pokemontools/scan_includes.py index 60929d3..53ff091 100644 --- a/pokemontools/scan_includes.py +++ b/pokemontools/scan_includes.py @@ -7,6 +7,7 @@ Recursively scan an asm file for dependencies. import sys import argparse +import os.path includes = set() @@ -17,11 +18,18 @@ def scan_file(filename): line = line.split(';')[0] if 'INCLUDE' in line: include = line.split('"')[1] - includes.add(include) - scan_file(include) + if os.path.exists("src/"): + includes.add("src/" + include) + scan_file("src/" + include) + else: + includes.add(include) + scan_file(include) elif 'INCBIN' in line: include = line.split('"')[1] - includes.add(include) + if 'baserom.gbc' not in line and os.path.exists("src/"): + includes.add("src/" + include) + else: + includes.add(include) def main(): ap = argparse.ArgumentParser() |