From: Eric S. Raymond Date: Tue, 10 Feb 2004 18:19:25 +0000 (+0000) Subject: We compile the tschebyshev example. X-Git-Tag: 1.0~128 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=1d6b6211b603556d89501309be4dd24ef3d2aae3;p=mad.git We compile the tschebyshev example. --- diff --git a/mad b/mad index 689377a..8132fe1 100755 --- a/mad +++ b/mad @@ -794,8 +794,8 @@ def print_statement(statement): defaulted.append(var) rep = rep[:-2] rep = rep + ") {\n" - if defaulted: - sys.stderr.write("warning: defaulted base type for %s\n" % ", ".join(defaulted)) + #if defaulted: + # sys.stderr.write("warning: defaulted base type for %s\n" % ", ".join(defaulted)) declarations = "" for type in ('double', 'int', 'bool'): vars = filter(lambda x: types[x] == type, types.keys()) @@ -989,23 +989,20 @@ if __name__ == '__main__': sys.stderr.write("mad: -o is required with multiple sourcefiles.\n") sys.exit(1) else: - for file in arguments: - stem = file[:-4] - out = open(stem + ".c", "w") - generate(out) - out.close() - srclist = " ".join(map(lambda x: x[:-4] + ".c", arguments)) + out = open(target + ".c", "w") + generate(out) + out.close() if binary: # Must be gcc, else compilation of internal functions will fail if hasmain: if not target: target = arguments[0][:-4] - compile = "gcc -std=c99 %s -lm -o %s" % (srclist, target) + compile = "gcc -std=c99 %s.c -lm -o %s" % (target, target) else: if not target: target = arguments[0][:-4] + ".o" - compile = "gcc -std=c99 -c %s -o %s" % (srclist, target) + compile = "gcc -std=c99 -c %s.c -o %s" % (target, target) if os.system(compile) == 0: - os.system("rm -f " + srclist) + os.system("rm -f " + target + ".c") # end