summaryrefslogtreecommitdiff
path: root/xmake/scripts/linker/_ar.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-01 10:03:16 +0800
committerruki <[email protected]>2015-06-01 10:09:10 +0800
commit7381a36a64f50a6db22155ebce996351201b90cb (patch)
treefea64527b0cf27c3d00691752ceca2a678546646 /xmake/scripts/linker/_ar.lua
parenta32ad41a1812ad88043c0ecd0a09301267de9871 (diff)
add linker and make link command
Diffstat (limited to 'xmake/scripts/linker/_ar.lua')
-rw-r--r--xmake/scripts/linker/_ar.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/xmake/scripts/linker/_ar.lua b/xmake/scripts/linker/_ar.lua
new file mode 100644
index 000000000..39aeadc56
--- /dev/null
+++ b/xmake/scripts/linker/_ar.lua
@@ -0,0 +1,51 @@
+--!The Automatic Cross-_ar Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2009 - 2015, ruki All rights reserved.
+--
+-- @author ruki
+-- @file _ar.lua
+--
+
+-- define module: _ar
+local _ar = _ar or {}
+
+-- load modules
+local utils = require("base/utils")
+local string = require("base/string")
+local config = require("base/config")
+
+-- init the linker
+function _ar._init(configs)
+
+end
+
+-- make the static library command
+function _ar._make_static(configs, objfiles, targetfile, flags)
+
+ -- make it
+ return string.format("%s -crs %s %s %s", configs.name, flags, targetfile, table.concat(objfiles))
+end
+
+-- map gcc flag to the current linker flag
+function _ar._mapflag(configs, flag)
+
+ -- ok
+ return flag
+end
+
+-- return module: _ar
+return _ar