summaryrefslogtreecommitdiff
path: root/xmake/tools/make.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-19 10:15:50 +0800
committerruki <[email protected]>2016-04-19 10:15:50 +0800
commit223c87f37fb9e8f3ffe808fae5041a1c4aee95d0 (patch)
tree2aad82da78da4444094a83ad5705f5cdeef28cd4 /xmake/tools/make.lua
parent9495e08a20c2aeda6b54a4b06b17057056c79ec9 (diff)
reimpl check tool
Diffstat (limited to 'xmake/tools/make.lua')
-rw-r--r--xmake/tools/make.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/tools/make.lua b/xmake/tools/make.lua
index 8cab41067..2785eaf73 100644
--- a/xmake/tools/make.lua
+++ b/xmake/tools/make.lua
@@ -31,6 +31,13 @@ function init(shellname)
end
+-- get the property
+function get(name)
+
+ -- get it
+ return _g[name]
+end
+
-- run it
function run(makefile, target, jobs)
@@ -74,3 +81,17 @@ function run(makefile, target, jobs)
end
end
+
+-- check the given flags
+function check(flags)
+
+ -- make an empty makefile
+ local tmpfile = os.tmpfile()
+ io.write(tmpfile, "all:\n")
+
+ -- check it
+ os.run("%s %s -f %s", _g.shellname, ifelse(flags, flags, ""), tmpfile)
+
+ -- remove this makefile
+ os.rm(tmpfile)
+end