summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-03 10:58:09 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-03 10:58:09 -0700
commit6c3b747a73ab8f69865ae9d0dc60b6130af518a2 (patch)
tree471a0df53e3664d0945ccb2eca15ec89b7aa2544
parent9d653c1ec47061e3985be018dfe29ad93a657ec1 (diff)
downloadmc-6c3b747a73ab8f69865ae9d0dc60b6130af518a2.tar.gz
Add a '-t' option to list all available targets.
-rw-r--r--mbld/main.myr11
1 files changed, 10 insertions, 1 deletions
diff --git a/mbld/main.myr b/mbld/main.myr
index 2a1dc33..0b5d54e 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -15,6 +15,7 @@ use "util.use"
const main = {args : byte[:][:]
var b : bld.build#
var mt : bld.myrtarg
+ var dumponly
var targname
var bintarg
var cmd
@@ -24,6 +25,7 @@ const main = {args : byte[:][:]
opts = [
.argdesc = "[inputs...]",
.opts = [
+ [.opt='t', .desc="list all available targets"],
[.opt='I', .arg="inc", .desc="add 'inc' to your include path"],
[.opt='R', .arg="root", .desc="install into 'root'"],
[.opt='b', .arg="bin", .desc="compile binary named 'bin' from inputs"],
@@ -39,8 +41,9 @@ const main = {args : byte[:][:]
bld.initopts()
for opt in cmd.opts
match opt
+ | ('t', ""): dumponly = true
+ | ('S', ""): bld.opt_genasm = true
| ('I', arg): bld.opt_incpaths = std.slpush(bld.opt_incpaths, arg)
- | ('S', _): bld.opt_genasm = true
| ('R', arg): bld.opt_instroot = arg
| ('b', arg):
targname = arg
@@ -89,6 +92,12 @@ const main = {args : byte[:][:]
else
bld.buildlib(b, &mt)
;;
+ elif dumponly
+ findproj(b, "bld.proj")
+ bld.load(b)
+ for t in b.all
+ std.put("%s\n", t)
+ ;;
else
findproj(b, "bld.proj")
bld.load(b)