From 9ea61e4e9f9ced9a937cedb8b4a24c2b0021c5a9 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 11 Jun 2020 00:32:51 +0800 Subject: add make.install --- xmake/modules/package/tools/make.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'xmake/modules/package/tools/make.lua') 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 -- cgit v1.3.1