mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
check that a source file exists before scanning it for includes
This commit is contained in:
parent
18656332b7
commit
38be374d0a
@ -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.
|
This is used to generate dependencies for each rgbasm object file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def scan_for_includes(filename):
|
def scan_for_includes(filename):
|
||||||
filenames = []
|
filenames = []
|
||||||
for line in open(filename, 'r').readlines():
|
if os.path.exists(filename):
|
||||||
if 'INCLUDE' in line or 'INCBIN' in line:
|
for line in open(filename, 'r').readlines():
|
||||||
line = line.split(';')[0]
|
|
||||||
if 'INCLUDE' in line or 'INCBIN' in line:
|
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
|
return filenames
|
||||||
|
|
||||||
def recursive_scan_for_includes(filename):
|
def recursive_scan_for_includes(filename):
|
||||||
|
Loading…
Reference in New Issue
Block a user