]> thyrsus.com Git - mad.git/commitdiff
We compile the tschebyshev example.
authorEric S. Raymond <esr@thyrsus,com>
Tue, 10 Feb 2004 18:19:25 +0000 (18:19 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Tue, 10 Feb 2004 18:19:25 +0000 (18:19 +0000)
mad

diff --git a/mad b/mad
index 689377a43f56e916c50b02c39438a06ca263af5b..8132fe1f852ebefc79363226755e91ca73735a29 100755 (executable)
--- 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