diff options
| author | DawnManget <[email protected]> | 2022-05-09 22:24:35 +0800 |
|---|---|---|
| committer | DawnManget <[email protected]> | 2022-05-09 22:24:35 +0800 |
| commit | a0a57a74cc301468d21f11cd5d78a272cce561b5 (patch) | |
| tree | 3c905bdf1a18cc188ae73915d3d840ff4e924974 /xmake/modules/core/tools/bl51.lua | |
| parent | 6f789c9db16eadf5c81b63221cddff59988da465 (diff) | |
add keil-c51 toolchain & rules
Diffstat (limited to 'xmake/modules/core/tools/bl51.lua')
| -rw-r--r-- | xmake/modules/core/tools/bl51.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/bl51.lua b/xmake/modules/core/tools/bl51.lua new file mode 100644 index 000000000..3b49bf0e3 --- /dev/null +++ b/xmake/modules/core/tools/bl51.lua @@ -0,0 +1,61 @@ +--!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 DawnMagnet +-- @file bl51.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 runtime flag +--function nf_runtime(self, runtime) +-- if runtime == "microlib" then +-- return "--library_type=microlib" +-- end +--end +-- +-- make the link arguments list +function linkargv(self, objectfiles, targetkind, targetfile, flags) + return self:program(), table.join(objectfiles, "TO", targetfile) +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 + |
