[hackers] [scc] [driver] write as(1) output files to .o || Quentin Rameau

From: <git_AT_suckless.org>
Date: Thu, 2 Jun 2016 19:26:36 +0200 (CEST)

commit f732da390b6dd2b9033090c9e739daa4cf6a4a5b
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu Jun 2 19:17:14 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Thu Jun 2 19:25:33 2016 +0200

    [driver] write as(1) output files to .o

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 4072f97..2bf2aba 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
_AT_@ -42,7 +42,7 @@ static struct tool {
 
 char *argv0;
 static char *arch;
-static char *outfiles[NR_TOOLS];
+static char *outfiles[NR_TOOLS + 1];
 static int failedtool = NR_TOOLS;
 static int Eflag, Sflag, kflag;
 
_AT_@ -51,7 +51,7 @@ cleanup(void)
 {
         int i;
 
- for (i = 0; i < NR_TOOLS; ++i) {
+ for (i = 0; i < NR_TOOLS + 1; ++i) {
                 if (outfiles[i]) {
                         if (i > failedtool)
                                 unlink(outfiles[i]);
_AT_@ -99,6 +99,9 @@ inittool(int tool)
                                 die("scc: target tool path too long");
                         strcat(t->cmd, t->bin);
                         break;
+ case AS:
+ t->args[1] = "-o";
+ break;
                 default:
                         break;
                 }
_AT_@ -143,6 +146,10 @@ settool(int tool, char *input, int output)
         case CC1:
                 t->args[1] = input;
                 break;
+ case AS:
+ outfiles[output] = newfileext(input, "o");
+ t->args[2] = outfiles[output];
+ break;
         case TEE:
                 switch (output) {
                 case CC2:
Received on Thu Jun 02 2016 - 19:26:36 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 02 2016 - 19:36:17 CEST