scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 3dd71e3263f1e6cca98649a1376c89bb22638c78
parent b7dbd49918a0863c8e9117aa6c82523a27a28b97
Author: Quentin Rameau <quinq@fifth.space>
Date:   Sat,  4 Jun 2016 13:12:17 +0200

[driver] add o flag for linking to specified file

Diffstat:
Mdriver/posix/scc.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 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()));