scc

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

commit 1f8ba936aa0b76b92cde96c1cd7e07bcc1fa2621
parent ade8a7d7850cdb0d3df5229d86bab2c7532e1fff
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  2 Jun 2016 13:23:34 +0200

Merge remote-tracking branch 'origin/master'

Diffstat:
MMakefile | 2+-
Mdriver/posix/scc.c | 16++++++----------
2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile @@ -39,7 +39,7 @@ install: all cp -f bin/cc1 $(PREFIX)/bin/cpp cp -f bin/scc $(PREFIX)/bin/ cd $(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc* - cd $(PREFIX)/bin && chmod 755 cpp scc && strip cpp + cd $(PREFIX)/bin && chmod 755 cpp scc && strip cpp scc uninstall: rm -rf $(PREFIX)/libexec/scc/ diff --git a/driver/posix/scc.c b/driver/posix/scc.c @@ -35,9 +35,9 @@ static struct tool { } tools[NR_TOOLS] = { [CC1] = { .bin = "cc1", .cmd = PREFIX "/libexec/scc/", }, [CC2] = { .bin = "cc2", .cmd = PREFIX "/libexec/scc/", }, - [QBE] = { .bin = "qbe", .bin = "qbe", .cmd = "qbe", }, - [AS] = { .bin = "cat", .bin = "cat", .cmd = "cat", }, - [TEE] = { .bin = "tee", .bin = "tee", .cmd = "tee", }, + [QBE] = { .bin = "qbe", .cmd = "qbe", }, + [AS] = { .bin = "as", .cmd = "as", }, + [TEE] = { .bin = "tee", .cmd = "tee", }, }; char *argv0; @@ -144,15 +144,15 @@ spawn(int t) void build(char *file) { - int tool, out, keepfile; - static int in = NR_TOOLS, preout; + pid_t pid; + int i, st, tool, out, keepfile; + static int preout; for (tool = CC1; tool < NR_TOOLS; tool = out) { keepfile = 0; switch (tool) { case CC1: - in = NR_TOOLS; out = Eflag ? NR_TOOLS : CC2; if (!Eflag) keepfile = kflag; @@ -187,7 +187,6 @@ build(char *file) } spawn(settool(inittool(tool), out)); - in = tool; } for (i = 0; i < NR_TOOLS; ++i) { if ((pid = tools[i].pid) == 0) @@ -209,9 +208,6 @@ usage(void) int main(int argc, char *argv[]) { - int st, i; - pid_t pid; - atexit(terminate); arch = getenv("ARCH");