summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-06-25 00:53:47 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-25 00:53:47 -0700
commita7c11c4d0a52661a299a90b47d9a68be8e11312f (patch)
tree3b765f39193155fccf4de6c60d4ad685189301fc /mbld
parentdc338852ab7da15657147df7df25eec078e09aa1 (diff)
downloadmc-a7c11c4d0a52661a299a90b47d9a68be8e11312f.tar.gz
Allow '.o' and '.6' files in inputs.
Generating an object makes sense, if you want to do weird things like generating OpenGL bindings.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/build.myr8
-rw-r--r--mbld/util.myr4
2 files changed, 10 insertions, 2 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 66558f4..680b075 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -210,8 +210,12 @@ const builddep = {b, dg, out, incs
match std.htget(dg.deps, out)
| `std.Some deps:
+ std.put("deps: {} => {}\n", out, deps)
for d in deps
- if builddep(b, dg, d, incs)
+ if std.sleq(out, d)
+ continue
+ ;;
+ if std.sleq(out, d) || builddep(b, dg, d, incs)
stale = true
;;
match std.htget(b.gensrc, d)
@@ -280,6 +284,8 @@ const compile = {dg, src, incs
std.slpush(&cmd, flg)
;;
run(cmd)
+ elif std.hassuffix(src, ".o") || std.hassuffix(src, ".6")
+ /* nothing to do with object files*/
else
std.fatal("Unknown file type for {}\n", src)
;;
diff --git a/mbld/util.myr b/mbld/util.myr
index dc03bdc..5cec15c 100644
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -64,7 +64,7 @@ const srcsplit = {src
platf = ""
suff = ""
- match std.strfind(src, "/")
+ match std.strrfind(src, "/")
| `std.Some i: fbase = i
| `std.None: fbase = 0
;;
@@ -103,6 +103,8 @@ const srcswapsuffix = {src, new
-> std.strcat(base, new)
elif std.hassuffix(suff, ".glue.c")
-> std.strjoin([base, ".glue", new][:], "")
+ elif std.hassuffix(src, ".o") || std.hassuffix(src, ".6")
+ -> std.sldup(src)
else
std.fatal("unrecognized source {}\n", src)
;;