summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-16 11:14:34 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-16 11:14:34 -0700
commit08871fe6b8e6161e988e1aa52a59da792273ab4a (patch)
tree5c565a9ea1f3917ba43d08f2312f88eba7506447 /mbld
parentb23b5b3f9a003382d092089ce00104be3cfddd9a (diff)
downloadmc-08871fe6b8e6161e988e1aa52a59da792273ab4a.tar.gz
Check freshness against the actual outputs.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/build.myr13
1 files changed, 7 insertions, 6 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 2d27b96..05628ac 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -128,7 +128,7 @@ const buildbin = {b, targ, addsrc
if !std.hthas(dg.deps, targ.name)
std.fatal("no input files for {}\n", targ.name)
;;
- if builddep(b, dg, targ.name, targ.incpath) || !freshlibs(targ, dg.libs)
+ if builddep(b, dg, targ.name, targ.incpath) || !freshlibs(targ, targ.name, dg.libs)
src = std.htkeys(dg.sources)
incs = std.sldup(targ.incpath)
@@ -144,7 +144,7 @@ const buildbin = {b, targ, addsrc
}
const buildlib = {b, targ
- var archive
+ var archive, usefile
var u, l
var dg
var lib, src
@@ -154,13 +154,14 @@ const buildlib = {b, targ
lib = targ.name
std.put("{}/lib{}.a...\n", b.curdir, lib)
archive = std.fmt("lib{}.a", lib)
+ usefile = std.fmt("lib{}.use", lib)
dg = myrdeps(b, targ, false, false)
if !std.hthas(dg.deps, lib)
std.fatal("no target declared for {}\n", lib)
;;
- u = builddep(b, dg, targ.name, targ.incpath)
+ u = builddep(b, dg, usefile, targ.incpath)
l = builddep(b, dg, archive, targ.incpath)
- if u || l || !freshlibs(targ, dg.libs)
+ if u || l || !freshlibs(targ, usefile, dg.libs)
src = std.htkeys(dg.sources)
mergeuse(dg, lib, src, targ.incpath)
archivelib(dg, lib, src, targ.incpath)
@@ -459,14 +460,14 @@ const findlib = {lib, incs
-> `std.None
}
-const freshlibs = {targ, libgraph
+const freshlibs = {targ, output, libgraph
var libs
libs = std.htkeys(libgraph)
for l in libs
match findlib(l, targ.incpath)
| `std.Some lib:
- if !isfresh(lib, targ.name)
+ if !isfresh(lib, output)
std.slfree(lib)
-> false
;;