summaryrefslogtreecommitdiff
path: root/mbld/subdir.myr
diff options
context:
space:
mode:
Diffstat (limited to 'mbld/subdir.myr')
-rw-r--r--mbld/subdir.myr23
1 files changed, 23 insertions, 0 deletions
diff --git a/mbld/subdir.myr b/mbld/subdir.myr
new file mode 100644
index 0000000..0efd958
--- /dev/null
+++ b/mbld/subdir.myr
@@ -0,0 +1,23 @@
+use std
+
+use "types.use"
+use "util.use"
+
+pkg bld =
+ const subdirs : (p : build#, subs : byte[:][:], targ : std.option(byte[:]) -> void)
+;;
+
+const subdirs = {p, subs, targ
+ for s in subs
+ std.put("Entering directory '%s'\n", s)
+ if !std.chdir(s)
+ std.fatal(1, "unable to enter directory %s\n", s)
+ ;;
+ run(p.cmd)
+ std.put("Leaving directory '%s'\n", s)
+ if !std.chdir("..")
+ std.fatal(1, "unable to leave directory %s\n", s)
+ ;;
+ ;;
+}
+