shithub: mc

Download patch

ref: 1813b4c97ae6b43914fc39b804abf40309071acd
parent: da52a8bf41174d1483c6094a339be759741df877
author: Ori Bernstein <[email protected]>
date: Sat May 24 09:23:12 EDT 2014

6m now generates usefiles.

    This should simplify and speed things up.

--- a/6/main.c
+++ b/6/main.c
@@ -8,6 +8,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <err.h>
 
 #include "parse.h"
 #include "opt.h"
@@ -68,6 +69,19 @@
     return buf;
 }
 
+static void genuse(char *path)
+{
+    FILE *f;
+    char buf[1024];
+
+    swapsuffix(buf, sizeof buf, path, ".myr", ".use");
+    f = fopen(buf, "w");
+    if (!f)
+        err(1, "Could not open path %s\n", buf);
+    writeuse(f, file);
+    fclose(f);
+}
+
 int main(int argc, char **argv)
 {
     int opt;
@@ -129,6 +143,7 @@
         }
         gen(file, buf);
         assem(buf, argv[i]);
+        genuse(argv[i]);
     }
 
     return 0;
--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -267,9 +267,6 @@
             goto done;
         if (isfresh(file, obj))
             goto done;
-        gencmd(&cmd, &ncmd, muse, file, NULL, 0);
-        run(cmd);
-
         if (genasm)
             extra[nextra++] = "-S";
         gencmd(&cmd, &ncmd, mc, file, extra, nextra);