improve error handling
This commit is contained in:
parent
6248dc554d
commit
05758a1557
8
jtlc
8
jtlc
@ -27,22 +27,24 @@ def main(argv):
|
||||
sys.stderr.write(argv[0] + ': no input files\n')
|
||||
return 1
|
||||
|
||||
success = True
|
||||
ofiles = []
|
||||
for s in args.sources:
|
||||
tf = tempfile.NamedTemporaryFile(suffix = '.c', delete = False)
|
||||
tfname = tf.name
|
||||
build(args, s, tf)
|
||||
success = build(args, s, tf)
|
||||
tf.close()
|
||||
if success:
|
||||
m = re.match('(.*)\.jtl', s)
|
||||
if m is not None:
|
||||
ofname = m.group(1) + '.o'
|
||||
else:
|
||||
ofname = s + '.o'
|
||||
do_compile(args, tfname, ofname)
|
||||
os.unlink(tfname)
|
||||
ofiles.append(ofname)
|
||||
os.unlink(tfname)
|
||||
|
||||
if not args.c:
|
||||
if success and not args.c:
|
||||
do_link(args, ofiles)
|
||||
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user