diff options
author | Ori Bernstein <ori@eigenstate.org> | 2018-03-20 20:10:14 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2018-03-20 20:10:14 -0700 |
commit | 40503a54ab7d481d67807eb35b2c359379a8415a (patch) | |
tree | 848e1ab6f21523a002dc5e6370f48e25994af185 | |
parent | 22f8aa508f0313cadc30f941f99fe5f0eb5b155f (diff) | |
download | mc-40503a54ab7d481d67807eb35b2c359379a8415a.tar.gz |
Add -T to use *only* the passed sytem tags.
-rw-r--r-- | lib/std/cmp.myr | 2 | ||||
-rw-r--r-- | mbld/main.myr | 2 | ||||
-rw-r--r-- | mbld/opts.myr | 2 | ||||
-rw-r--r-- | mbld/syssel.myr | 43 |
4 files changed, 29 insertions, 20 deletions
diff --git a/lib/std/cmp.myr b/lib/std/cmp.myr index 15d2f98..f99c3fe 100644 --- a/lib/std/cmp.myr +++ b/lib/std/cmp.myr @@ -10,7 +10,7 @@ pkg std = `After ;; - generic numcmp : (a : @a, b : @a -> order) + generic numcmp : (a : @a, b : @a -> order) :: numeric @a const strcmp : (a : byte[:], b : byte[:] -> order) const strncmp : (a : byte[:], b : byte[:], n : size -> order) const strcasecmp : (a : byte[:], b : byte[:] -> order) 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 |