diff --git a/jtlc b/jtlc index 759bb3d..7ad3ac2 100755 --- a/jtlc +++ b/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() - m = re.match('(.*)\.jtl', s) - if m is not None: - ofname = m.group(1) + '.o' - else: - ofname = s + '.o' - do_compile(args, tfname, ofname) + 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) + ofiles.append(ofname) os.unlink(tfname) - ofiles.append(ofname) - if not args.c: + if success and not args.c: do_link(args, ofiles) return 0