summaryrefslogtreecommitdiff
path: root/mbld/deps.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-04 00:29:06 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-04 00:29:06 -0700
commit40d6f7b5cc0cb9e5de1675a1441ad0dfc0a66bda (patch)
tree7bd30d6141afb2516bd695ce824b9b4fb1b51311 /mbld/deps.myr
parentcf1c6aa5e3025d81896eba7d3f0858b37bdc7309 (diff)
downloadmc-40d6f7b5cc0cb9e5de1675a1441ad0dfc0a66bda.tar.gz
`mbld bench` now works.
Diffstat (limited to 'mbld/deps.myr')
-rw-r--r--mbld/deps.myr26
1 files changed, 21 insertions, 5 deletions
diff --git a/mbld/deps.myr b/mbld/deps.myr
index e4f0bd2..1ed9981 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -105,6 +105,13 @@ const myrdeps = {b, name, mt
n.wdir = std.sldup(mt.dir)
std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, mt.name][:]))
+ elif mt.isbench
+ n = node(g, mt.name)
+ depends(g, n, to)
+ addnode(g, "bench", n)
+
+ n.wdir = std.sldup(mt.dir)
+ std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, mt.name][:]))
else
addnode(g, "all", go)
go.instdir = config.Binpath
@@ -264,10 +271,19 @@ const datdeps = {b, name, dt
const addtests = {b, name, mt
for f : mt.inputs
addtest(b, mt, f)
+ addbench(b, mt, f)
;;
}
const addtest = {b, mt, f
+ addalt(b, mt, "test", f)
+}
+
+const addbench = {b, mt, f
+ addalt(b, mt, "bench", f)
+}
+
+const addalt = {b, mt, kind, f
var libs, deps
var sp, tp, op
var s, t, o
@@ -280,7 +296,7 @@ const addtest = {b, mt, f
*/
g = b.deps
s = changesuffix(f, ".myr")
- sp = std.pathjoin([mt.dir, "test", s][:])
+ sp = std.pathjoin([mt.dir, kind, s][:])
std.slfree(s)
if !std.fexists(sp)
std.slfree(sp)
@@ -291,11 +307,11 @@ const addtest = {b, mt, f
leaf(g, sp)
t = changesuffix(f, "")
- tp = std.pathjoin([opt_objdir, mt.dir, "test", t][:])
+ tp = std.pathjoin([opt_objdir, mt.dir, kind, t][:])
std.slfree(t)
o = changesuffix(f, config.Objsuffix)
- op = std.pathjoin([opt_objdir, mt.dir, "test", o][:])
+ op = std.pathjoin([opt_objdir, mt.dir, kind, o][:])
std.slfree(o)
n = node(g, sp)
@@ -325,9 +341,9 @@ const addtest = {b, mt, f
n = node(g, tp)
depends(g, n, tp)
n.wdir = std.sldup(std.dirname(std.dirname(sp)))
- std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, "test", std.basename(tp)][:]))
+ std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, kind, std.basename(tp)][:]))
- addnode(g, "test", n)
+ addnode(g, kind, n)
}
const resolve = {b