summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/makefile.lua
diff options
context:
space:
mode:
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