diff options
| author | ruki <[email protected]> | 2021-10-26 22:14:14 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-26 22:14:14 +0800 |
| commit | 1115732be0fb8f1eb24b37d39b22dc187ed9062f (patch) | |
| tree | f6c06f01cac654338f0d6110e6c3665b23adcb72 /xmake/modules/core/tools/armlink.lua | |
| parent | df89676a5a905ced4cae2be987742c1d4d91c563 (diff) | |
| parent | 63c46927a81593033193b12bbf3a72db5c9726dd (diff) | |
Merge pull request #1773 from xmake-io/keil
Add armcc/armclang support for Keil/MDK
Diffstat (limited to 'xmake/modules/core/tools/armlink.lua')
| -rw-r--r-- | xmake/modules/core/tools/armlink.lua | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/armlink.lua b/xmake/modules/core/tools/armlink.lua new file mode 100644 index 000000000..02c2b4800 --- /dev/null +++ b/xmake/modules/core/tools/armlink.lua @@ -0,0 +1,54 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, TBOOX Open Source Group. +-- +-- @author ruki +-- @file armlink.lua +-- + +-- imports +import("core.base.option") +import("core.base.global") +import("utils.progress") + +function 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 + |
