summaryrefslogtreecommitdiff
path: root/mbld/clean.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-04-17 11:43:11 -0700
committerOri Bernstein <ori@eigenstate.org>2015-04-17 11:43:11 -0700
commitc05e4d021a24645c06092dda39c6befdf77ec813 (patch)
tree6ba6f2c2c1f90653d1848ff837e6fdcef113f042 /mbld/clean.myr
parent97f03b720b5d8656a316ce1ca14b89d4a411c59f (diff)
downloadmc-c05e4d021a24645c06092dda39c6befdf77ec813.tar.gz
Topologically sort targets.
This avoids tons of ugly, spurious chdir calls, as well as detecting cycles in library dependencies.
Diffstat (limited to 'mbld/clean.myr')
-rw-r--r--mbld/clean.myr4
1 files changed, 1 insertions, 3 deletions
diff --git a/mbld/clean.myr b/mbld/clean.myr
index 5452ae5..69549fa 100644
--- a/mbld/clean.myr
+++ b/mbld/clean.myr
@@ -4,7 +4,6 @@ use "config.use"
use "deps.use"
use "opts.use"
use "parse.use"
-use "subdir.use"
use "types.use"
use "util.use"
@@ -70,7 +69,7 @@ const cleanup = {b, targ, leaves, islib
we want to automatically add 'clean' sources since otherwise,
mbld won't be able to clean code after changing a build file.
*/
- pushdir(b, targ.dir)
+ setdir(b, targ.dir)
if !myrdeps(b, targ, islib, true, true, &dg)
std.fatal(1, "Could not load dependencies for %s\n", targ.name)
;;
@@ -85,6 +84,5 @@ const cleanup = {b, targ, leaves, islib
std.put("\tclean %s\n", k)
;;
;;
- popdir(b)
}