summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-11-03 21:22:05 -0700
committerOri Bernstein <ori@eigenstate.org>2017-11-03 21:23:31 -0700
commitac297546f368b4adc1b0f21ecd69eb9eb33eb329 (patch)
tree92f6c237992d3a2031d1757c3213097d9c4ab1c5
parentcc3afe8080e433d68406cf51615a9530ecbbba68 (diff)
downloadmc-ac297546f368b4adc1b0f21ecd69eb9eb33eb329.tar.gz
Rebuild when installed libraries change.
-rw-r--r--mbld/build.myr2
-rw-r--r--mbld/deps.myr3
-rw-r--r--mbld/libs.myr12
-rw-r--r--mbld/types.myr3
4 files changed, 10 insertions, 10 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 1d81c6f..7dfec99 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -125,7 +125,7 @@ const unblock = {b, n
const stale = {b, n
var staletime
- staletime = 0
+ staletime = n.deptime
for d : n.ndep
staletime = std.max(staletime, d.mtime)
;;
diff --git a/mbld/deps.myr b/mbld/deps.myr
index 1ad1b22..c67bef0 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -589,7 +589,7 @@ const xdepends = {b, g, n, dep
depends(g, n, ldep.genuse)
depends(g, n, ldep.genar)
;;
- std.slpush(&n.xdep, dep)
+ n.deptime = std.max(n.deptime, ldep.mtime)
| `std.None:
std.fatal("unknown xdep {} (known: {})\n", dep, std.htkeys(b.libs))
;;
@@ -631,7 +631,6 @@ const node = {g, lbl
.cmd=[][:],
.gen=[][:],
.dep=[][:],
- .xdep=[][:],
.nblock=0,
.mtime=0,
diff --git a/mbld/libs.myr b/mbld/libs.myr
index 487d110..d1307ff 100644
--- a/mbld/libs.myr
+++ b/mbld/libs.myr
@@ -46,14 +46,14 @@ const builtlib = {b, mt, dep, dyndep
}
const scrapelib = {b, targ, lib, incs
- var dep, dyndep, ldep
+ var path, dep, dyndep, ldep
var f, dir
if std.hthas(b.libs, lib)
-> void
;;
- (f, dir) = openlib(lib, targ, incs)
+ (f, path, dir) = openlib(lib, targ, incs)
match bio.getc(f)
| `std.Ok 'U': /* ok */
| `std.Ok _: std.fput(1, "{}/{}: not a usefile\n", dir, lib)
@@ -84,7 +84,9 @@ const scrapelib = {b, targ, lib, incs
.dyndep=dyndep,
.genuse="",
.genar="",
+ .mtime=std.tryv(std.fmtime(path), 0)
])
+ std.slfree(path)
std.htput(b.libs, lib, ldep)
for d : dep
@@ -103,10 +105,8 @@ const openlib = {lib, targ, incs
std.slfree(libname)
if std.fisreg(path)
match bio.open(path, bio.Rd)
- | `std.Ok file:
- std.slfree(path)
- -> (file, p)
- | `std.Err m:
+ | `std.Ok file: -> (file, path, p)
+ | `std.Err m: /* next */
;;
std.fatal("{}: {} does not exist in {j=, }\n", targ, lib, incs)
;;
diff --git a/mbld/types.myr b/mbld/types.myr
index 7731cb4..0d671e6 100644
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -82,6 +82,7 @@ pkg bld =
dyndep : byte[:][:]
genuse : byte[:]
genar : byte[:]
+ mtime : std.time
;;
type testresult = union
@@ -114,7 +115,7 @@ pkg bld =
/* dependency names */
gen : byte[:][:]
dep : byte[:][:]
- xdep : byte[:][:]
+ deptime : std.time
/* resolved dependency nodes */
ndep : node#[:]