summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/make.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-11 00:32:51 +0800
committerruki <[email protected]>2020-06-10 21:17:11 +0800
commit9ea61e4e9f9ced9a937cedb8b4a24c2b0021c5a9 (patch)
treee48c3238ddec39f8924fb2f5deaa7835bfcd9f5b /xmake/modules/package/tools/make.lua
parent78f1671c09dcee3802fc3bc69211f38179e555d8 (diff)
add make.install
Diffstat (limited to 'xmake/modules/package/tools/make.lua')
-rw-r--r--xmake/modules/package/tools/make.lua29
1 files changed, 28 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/make.lua b/xmake/modules/package/tools/make.lua
index 011383366..498feb4fa 100644
--- a/xmake/modules/package/tools/make.lua
+++ b/xmake/modules/package/tools/make.lua
@@ -97,10 +97,37 @@ function build(package, configs, opt)
end
end
- -- do configure
+ -- do build
if is_host("bsd") then
os.vrunv("gmake", argv, {envs = opt.envs or buildenvs(package)})
else
os.vrunv("make", argv, {envs = opt.envs or buildenvs(package)})
end
end
+
+-- install package
+function install(package, configs)
+
+ -- pass configurations
+ local argv = {"install"}
+ if option.get("verbose") then
+ table.insert(argv, "VERBOSE=1")
+ end
+ for name, value in pairs(configs) do
+ value = tostring(value):trim()
+ if value ~= "" then
+ if type(name) == "number" then
+ table.insert(argv, value)
+ else
+ table.insert(argv, name .. "=" .. value)
+ end
+ end
+ end
+
+ -- do install
+ if is_host("bsd") then
+ os.vrunv("gmake", argv)
+ else
+ os.vrunv("make", argv)
+ end
+end