shithub: scc

Download patch

ref: fc869c93e25523e86b11850700016efcb3f0b4db
parent: adfcb52cc4fa5f77155afec2d60b6d9383006d69
author: Quentin Rameau <quinq@fifth.space>
date: Thu Jun 9 07:20:55 EDT 2016

[driver] add c flag

--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -48,7 +48,7 @@
 static char *arch;
 static char **tmpobjs;
 static int nobjs;
-static int Eflag, Sflag, kflag;
+static int Eflag, Sflag, cflag, kflag;
 
 static void
 cleanfiles(int tool)
@@ -353,7 +353,7 @@
 			nexttool = Sflag ? LAST_TOOL : AS;
 			break;
 		case AS:
-			nexttool = LD;
+			nexttool = cflag ? LAST_TOOL : LD;
 			break;
 		case LD: /* FALLTHROUGH */
 			if (argfile) {
@@ -376,7 +376,7 @@
 static void
 usage(void)
 {
-	die("usage: %s [-E|-kS] [-w] [-m arch] [-o binout]\n"
+	die("usage: %s [-E|-kS] [-w] [-m arch] [-c] [-o binout]\n"
 	    "       [-D macro[=val]]... [-I dir]... file...", argv0);
 }
 
@@ -407,6 +407,9 @@
 	case 'S':
 		Sflag = 1;
 		break;
+	case 'c':
+		cflag = 1;
+		break;
 	case 'k':
 		kflag = 1;
 		break;
@@ -440,7 +443,7 @@
 	for (; *argv; ++argv)
 		build(*argv);
 
-	if (!(Eflag || Sflag))
+	if (!(Eflag || Sflag || cflag))
 		linkobjs();
 
 	return 0;