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())
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