diff options
author | yenatch <yenatch@gmail.com> | 2013-12-20 02:43:35 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-12-20 02:44:44 -0500 |
commit | 34d579d9f91eebd81d025bd669b22e0a629fd549 (patch) | |
tree | 7ecacc8b3667e39a64a9110ec2a54c17e0a578a6 /scan_includes.py | |
parent | cad6f30f83e64c34c8b474d579deaff3856b5235 (diff) |
use pokemontools scan_includes.py
It might look the same as before, but this new name is much better! Well done!
Diffstat (limited to 'scan_includes.py')
-rw-r--r-- | scan_includes.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/scan_includes.py b/scan_includes.py deleted file mode 100644 index 3ea4c9994..000000000 --- a/scan_includes.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding: utf-8 - -""" -Recursively scan an asm file for rgbasm INCLUDEs and INCBINs. -Used to generate dependencies for each rgbasm object. -""" - -import os -import sys - -def recursive_scan(filename, includes = []): - if (filename[-4:] == '.asm' or filename[-3] == '.tx') and os.path.exists(filename): - lines = open(filename).readlines() - for line in lines: - for directive in ('INCLUDE', 'INCBIN'): - if directive in line: - line = line[:line.find(';')] - if directive in line: - include = line.split('"')[1] - if include not in includes: - includes += [include] - includes = recursive_scan(include, includes) - break - return includes - -if __name__ == '__main__': - filenames = sys.argv[1:] - for filename in filenames: - sys.stdout.write(' '.join(recursive_scan(filename))) - |