diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-11 18:05:41 -0700 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-11 18:05:41 -0700 |
commit | d536990828adee8a47e71f24ec45900ea783cd7a (patch) | |
tree | 013c23dd6969ecba4cd199e24447d640097bcb52 /scan_includes.py | |
parent | 18656332b7b4ca67461d4cd4b6b8282d3bc7ab0c (diff) | |
parent | 81c5f251a6e253a43344e4695209df871c41045c (diff) |
Merge pull request #203 from yenatch/globals
consolidate labels across objects into globals.asm
Diffstat (limited to 'scan_includes.py')
-rw-r--r-- | scan_includes.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scan_includes.py b/scan_includes.py index 3f006998c..0abd3084a 100644 --- a/scan_includes.py +++ b/scan_includes.py @@ -5,15 +5,17 @@ Recursively scan an asm file for rgbasm INCLUDEs and INCBINs. This is used to generate dependencies for each rgbasm object file. """ +import os import sys def scan_for_includes(filename): filenames = [] - for line in open(filename, 'r').readlines(): - if 'INCLUDE' in line or 'INCBIN' in line: - line = line.split(';')[0] + if os.path.exists(filename): + for line in open(filename, 'r').readlines(): if 'INCLUDE' in line or 'INCBIN' in line: - filenames += [line.split('"')[1]] + line = line.split(';')[0] + if 'INCLUDE' in line or 'INCBIN' in line: + filenames += [line.split('"')[1]] return filenames def recursive_scan_for_includes(filename): |