shithub: mc

Download patch

ref: 36d8051e6fb675aff71d37c9ab79e93239e1521f
parent: b22fbb6351d844d58002c326809258016595ed31
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jul 24 19:10:12 EDT 2017

Remove unused/useless options.

--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -15,7 +15,6 @@
 
 const main = {args : byte[:][:]
 	var b : bld.build#
-	var bintarg
 	var targname
 	var runsrc
 	var path
@@ -28,6 +27,7 @@
 	cmd = std.optparse(args, &[
 		.argdesc = "[inputs...]",
 		.opts = [
+			[.opt='j', .arg="jobs", .desc="build with at most 'jobs' jobs"],
 			[.opt='t', .arg="tag", .desc="build with specified systag"],
 			[.opt='S', .desc="generate assembly when building"],
 			[.opt='d', .desc="dump debugging information for mbld"],
@@ -34,9 +34,8 @@
 			[.opt='I', .arg="inc", .desc="add 'inc' to your include path"],
 			[.opt='R', .arg="runsrc", .desc="source to compile and run"],
 			[.opt='B', .arg="base", .desc="install into 'base'"],
-			[.opt='b', .arg="bin", .desc="compile binary named 'bin' from inputs"],
-			[.opt='l', .arg="lib", .desc="compile lib named 'lib' from inputs"],
-			[.opt='r', .arg="rt", .desc="link against runtime 'rt' instead of default"],
+			[.opt='b', .arg="bin", .desc="compile binary 'bin' from inputs"],
+			[.opt='r', .arg="rt", .desc="link against runtime 'rt'"],
 			[.opt='o', .arg="dir", .desc="output directory"],
 		][:]
 	])
@@ -53,27 +52,12 @@
 		| ('I', arg):	std.slpush(&bld.opt_incpaths, arg)
 		| ('B', arg):	bld.opt_instbase = arg
 		| ('t', tag):	std.slpush(&tags, tag)
+		| ('j', arg):	bld.opt_maxproc = std.getv(std.intparse(arg), 1)
 		| ('R', arg):	runsrc = arg
 		| ('o', arg):	bld.opt_objdir = arg
-		| ('b', arg):
-			targname = arg
-			bintarg = true
-		| ('l', arg):
-			targname = arg
-			bintarg = false
-		| ('r', arg):
-			if std.sleq(arg, "none")
-				bld.opt_runtime = ""
-			else
-				bld.opt_runtime = arg
-			;;
-		/*
-		internal undocumented args; used by compiler suite for
-		building with an uninstalled compiler.
-		*/
-		| ('d', arg): bld.opt_debug = true
-		| _:	std.die("unreachable\n")
-
+		| ('b', arg):	targname = arg
+		| ('r', arg):	bld.opt_runtime = arg
+		| _:		std.die("unreachable\n")
 		;;
 	;;
 	path = std.pathcat(bld.opt_instbase, config.Libpath)
@@ -104,7 +88,6 @@
 		bld.deps(b)
 		bld.testdeps(b)
 		bld.resolve(b)
-		/*bld.configure()*/
 		/* default: buildall */
 		if cmd.args.len == 0
 			ok = bld.buildtarg(b, "all")
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -56,9 +56,10 @@
 	var dir, res, log, logfd
 	var sub
 
+	mbldput("run {}: ", n.lbl)
 	dir = std.pathcat(b.basedir, n.wdir)
-	mbldput("run {} in {}:\t", n.lbl, dir)
 	std.chdir(dir)
+	std.slfree(dir)
 	match std.spork(n.cmd)
 	| `std.Err m:
 		std.fatal("\nunable to run test: {}\n", m)
@@ -84,10 +85,9 @@
 			;;
 		;;
 		if !res
-			std.slpush(failed, std.fmt("{j= } || {}", n.cmd, dir))
+			std.slpush(failed, std.fmt("{j= }", n.cmd))
 		;;
 	;;
-	//std.slfree(dir)
 	-> res
 }