summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/makefile.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-18 13:05:14 +0800
committerruki <[email protected]>2015-05-18 13:05:14 +0800
commitf1de3034b9afbb88f83501730bf27c31078818ed (patch)
tree88a2c43f6521628df368071d44c861eb826636f4 /xmake/scripts/base/makefile.lua
parent3f53e1ea0f6c9deff5295e689df141feba9cce4c (diff)
build makefile
Diffstat (limited to 'xmake/scripts/base/makefile.lua')
-rw-r--r--xmake/scripts/base/makefile.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua
index 754131fa4..b7d8813ee 100644
--- a/xmake/scripts/base/makefile.lua
+++ b/xmake/scripts/base/makefile.lua
@@ -135,5 +135,27 @@ function makefile.make()
return true
end
+-- build target
+function makefile.build(target)
+
+ -- check
+ assert(target and type(target) == "string")
+
+ -- the configs
+ local configs = config._CONFIGS
+ assert(configs and configs.buildir)
+
+ -- done build
+ local ok = os.execute(string.format("make -f %s %s", configs.buildir .. "/makefile", target))
+ if ok ~= 0 then
+ -- error
+ utils.error("build target: %s failed!", target)
+ return false
+ end
+
+ -- ok
+ return true
+end
+
-- return module: makefile
return makefile