ref: 38be374d0a59512e4d5cd282b9910bf9630e0a93
parent: 18656332b7b4ca67461d4cd4b6b8282d3bc7ab0c
author: yenatch <[email protected]>
date: Wed Sep 11 15:17:25 EDT 2013
check that a source file exists before scanning it for includes
--- a/scan_includes.py
+++ b/scan_includes.py
@@ -5,15 +5,17 @@
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):