summaryrefslogtreecommitdiff
path: root/mbld/build.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-04-16 14:13:47 -0700
committerOri Bernstein <ori@eigenstate.org>2015-04-16 14:13:47 -0700
commit9df78d333d4fcc74754e16ddf06c2fba58c9858a (patch)
tree03f1f12dcd4cb74f0e6cc4fd63b95f9234b4ec5a /mbld/build.myr
parentb7747c5a3d36f99514b1945efb05b9f04f7dc74a (diff)
downloadmc-9df78d333d4fcc74754e16ddf06c2fba58c9858a.tar.gz
Push/pop directories appropriately.
We had bugs because this was done by just setting dirs, without properly changing back at the end of a command. Ordering of build targets would break builds.
Diffstat (limited to 'mbld/build.myr')
-rw-r--r--mbld/build.myr8
1 files changed, 6 insertions, 2 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 19baa73..39caa9d 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -57,7 +57,7 @@ const buildbin = {b, targ, addsrc
if targ.built
->
;;
- setdir(b, targ.dir)
+ pushdir(b, targ.dir)
addincludes(b, targ)
buildlibdeps(b, targ)
std.put("%s...\n", targ.name)
@@ -73,6 +73,7 @@ const buildbin = {b, targ, addsrc
std.slfree(src)
;;
targ.built = true
+ popdir(b)
}
const buildlib = {b, targ
@@ -84,7 +85,7 @@ const buildlib = {b, targ
if targ.built
->
;;
- setdir(b, targ.dir)
+ pushdir(b, targ.dir)
addincludes(b, targ)
buildlibdeps(b, targ)
lib = targ.name
@@ -106,15 +107,18 @@ const buildlib = {b, targ
;;
std.slfree(archive)
targ.built = true
+ popdir(b)
}
const genfiles = {b, gt
+ pushdir(b, gt.dir)
for f in gt.out
if !std.fexists(f)
run(gt.cmd)
break
;;
;;
+ popdir(b)
}
const addincludes = {b, targ