summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-26 23:27:19 +0800
committerruki <[email protected]>2021-10-26 23:27:19 +0800
commitdea09f243e33b43c8c8be40d8a471b4580db1de7 (patch)
tree86b3b01f70fb6285cbbec3f5b457a04235dd7f78 /xmake/modules/core/tools
parent80dd8e90c0eea596298463e521e64b27c4995a4d (diff)
improve armlink
Diffstat (limited to 'xmake/modules/core/tools')
-rw-r--r--xmake/modules/core/tools/armlink.lua33
1 files changed, 31 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/armlink.lua b/xmake/modules/core/tools/armlink.lua
index 34895be6c..02c2b4800 100644
--- a/xmake/modules/core/tools/armlink.lua
+++ b/xmake/modules/core/tools/armlink.lua
@@ -18,8 +18,37 @@
-- @file armlink.lua
--
-inherit("gcc")
+-- imports
+import("core.base.option")
+import("core.base.global")
+import("utils.progress")
function init(self)
- _super.init(self)
end
+
+-- make the link flag
+function nf_link(self, lib)
+ return "lib" .. lib .. ".a"
+end
+
+-- make the syslink flag
+function nf_syslink(self, lib)
+ return nf_link(self, lib)
+end
+
+-- make the linkdir flag
+function nf_linkdir(self, dir)
+ return {"--userlibpath", dir}
+end
+
+-- make the link arguments list
+function linkargv(self, objectfiles, targetkind, targetfile, flags)
+ return self:program(), table.join("-o", targetfile, objectfiles, flags)
+end
+
+-- link the target file
+function link(self, objectfiles, targetkind, targetfile, flags)
+ os.mkdir(path.directory(targetfile))
+ os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
+end
+