commit 3dd71e3263f1e6cca98649a1376c89bb22638c78
Author:     Quentin Rameau <quinq@fifth.space>
AuthorDate: Sat Jun 4 13:12:17 2016 +0200
Commit:     Quentin Rameau <quinq@fifth.space>
CommitDate: Tue Jun 7 14:30:03 2016 +0200

    [driver] add o flag for linking to specified file

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 332bd12..4f0944d 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -160,10 +160,9 @@ settool(int tool, char *input, int nexttool)
                t->args[2] = t->outfile;
                break;
        case LD:
-               if (!t->outfile) {
+               if (!t->outfile)
                        t->outfile = "a.out";
-                       t->args[2] = t->outfile;
-               }
+               t->args[2] = t->outfile;
                break;
        case TEE:
                switch (nexttool) {
@@ -354,7 +353,7 @@ build(char *file)
 static void
 usage(void)
 {
-       die("usage: %s [-E|-kS] [-m arch] [-D macro[=val]]... "
+       die("usage: %s [-E|-kS] [-m arch] [-o binout] [-D macro[=val]]... "
            "[-I dir]... file ...", argv0);
 }
 
@@ -387,6 +386,9 @@ main(int argc, char *argv[])
        case 'm':
                arch = EARGF(usage());
                break;
+       case 'o':
+               tools[LD].outfile = EARGF(usage());
+               break;
        case '-':
                fprintf(stderr,
                        "scc: ignored parameter --%s\n", EARGF(usage()));

Reply via email to