aboutsummaryrefslogtreecommitdiff
path: root/driver.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-07-07 00:36:36 -0700
committerMichael Forney <mforney@mforney.org>2019-07-07 00:38:15 -0700
commit8b4905a7ad2a749e6cff085e8a9ca5895b118e06 (patch)
tree0d8d372d3e531ee079bbddbb8546043828637a28 /driver.c
parent4b3e5a6bd64335ad207167fa8fd39a098c50c1db (diff)
driver: Print error message when run with unsupported target
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/driver.c b/driver.c
index bdb312a..cd6bc5e 100644
--- a/driver.c
+++ b/driver.c
@@ -362,6 +362,8 @@ main(int argc, char *argv[])
struct input *input;
size_t i;
+ argv0 = progname(argv[0], "cproc");
+
arrayaddbuf(&phases[PREPROCESS].cmd, preprocesscmd, sizeof(preprocesscmd));
arrayaddptr(&phases[COMPILE].cmd, compilecommand(argv[0]));
arrayaddbuf(&phases[CODEGEN].cmd, codegencmd, sizeof(codegencmd));
@@ -374,13 +376,14 @@ main(int argc, char *argv[])
} else if (hasprefix(target, "aarch64-")) {
arch = "aarch64";
qbearch = "arm64";
+ } else {
+ fatal("unsupported target '%s'", target);
}
arrayaddptr(&phases[COMPILE].cmd, "-t");
arrayaddptr(&phases[COMPILE].cmd, arch);
arrayaddptr(&phases[CODEGEN].cmd, "-t");
arrayaddptr(&phases[CODEGEN].cmd, qbearch);
- argv0 = progname(argv[0], "cproc");
for (;;) {
++argv, --argc;
arg = *argv;