summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-03-20 20:10:14 -0700
committerOri Bernstein <ori@eigenstate.org>2018-03-20 20:10:14 -0700
commit40503a54ab7d481d67807eb35b2c359379a8415a (patch)
tree848e1ab6f21523a002dc5e6370f48e25994af185 /mbld
parent22f8aa508f0313cadc30f941f99fe5f0eb5b155f (diff)
downloadmc-40503a54ab7d481d67807eb35b2c359379a8415a.tar.gz
Add -T to use *only* the passed sytem tags.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/main.myr2
-rw-r--r--mbld/opts.myr2
-rw-r--r--mbld/syssel.myr43
3 files changed, 28 insertions, 19 deletions
diff --git a/mbld/main.myr b/mbld/main.myr
index c6ba199..3ca9b07 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -29,6 +29,7 @@ const main = {args : byte[:][:]
.opts = [
[.opt='j', .arg="jobs", .desc="build with at most 'jobs' jobs"],
[.opt='t', .arg="tag", .desc="build with specified systag"],
+ [.opt='T', .arg="tag", .desc="build with only the specified systag"],
[.opt='S', .desc="generate assembly when building"],
[.opt='I', .arg="inc", .desc="add 'inc' to your include path"],
[.opt='R', .arg="runsrc", .desc="source to compile and run"],
@@ -51,6 +52,7 @@ const main = {args : byte[:][:]
| ('I', arg): std.slpush(&bld.opt_incpaths, arg)
| ('B', arg): bld.opt_instbase = arg
| ('t', tag): std.slpush(&tags, tag)
+ | ('T', tag): std.slpush(&bld.opt_alltags, tag)
| ('j', arg): bld.opt_maxproc = std.getv(std.intparse(arg), 1)
| ('R', arg): runsrc = arg
| ('o', arg): bld.opt_objdir = arg
diff --git a/mbld/opts.myr b/mbld/opts.myr
index 6b5e4c5..a4679c7 100644
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -10,6 +10,7 @@ pkg bld =
var opt_runtime : byte[:]
var opt_genasm : bool
var opt_incpaths : byte[:][:]
+ var opt_alltags : byte[:][:]
var opt_mcflags : byte[:][:]
var opt_museflags : byte[:][:]
var opt_ldflags : byte[:][:]
@@ -48,6 +49,7 @@ var opt_muse = "muse"
var opt_mcflags = [][:]
var opt_museflags = [][:]
var opt_ldflags = [][:]
+var opt_alltags = [][:]
var opt_objdir = "obj"
var opt_genasm = false
var opt_silent = false
diff --git a/mbld/syssel.myr b/mbld/syssel.myr
index 93ac581..f1452dc 100644
--- a/mbld/syssel.myr
+++ b/mbld/syssel.myr
@@ -142,27 +142,32 @@ generic sysselfin = {syssel
}
const addsysattrs = {b, tags
- std.htput(b.tags, opt_sys, opt_sysvers)
-
- match opt_sys
- | "freebsd": tag(b, "posixy")
- | "netbsd": tag(b, "posixy")
- | "openbsd": tag(b, "posixy")
- | "osx": tag(b, "posixy")
- | "linux": tag(b, "posixy")
- | "plan9":
- | unknown: std.fatal("unknown system \"{}\"\n", unknown)
- ;;
+ if opt_alltags.len > 0
+ for t : opt_alltags
+ tag(b, t)
+ ;;
+ else
+ std.htput(b.tags, opt_sys, opt_sysvers)
+
+ match opt_sys
+ | "freebsd": tag(b, "posixy")
+ | "netbsd": tag(b, "posixy")
+ | "openbsd": tag(b, "posixy")
+ | "osx": tag(b, "posixy")
+ | "linux": tag(b, "posixy")
+ | "plan9":
+ | unknown: std.fatal("unknown system \"{}\"\n", unknown)
+ ;;
- match opt_arch
- | "x64": tag(b, "x64")
- | unknown: std.fatal("unknown architecture {}\n", unknown)
- ;;
- for t : tags
- tag(b, t)
+ match opt_arch
+ | "x64": tag(b, "x64")
+ | unknown: std.fatal("unknown architecture {}\n", unknown)
+ ;;
+ for t : tags
+ tag(b, t)
+ ;;
+ loadtagfile(b, "bld.tag")
;;
-
- loadtagfile(b, "bld.tag")
}
const loadtagfile = {b, tagfile