summaryrefslogtreecommitdiff
path: root/xmake/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2017-06-21 08:41:22 +0800
committerruki <[email protected]>2017-06-21 08:41:22 +0800
commit45a54659f7449ead7ed073f9c0cbbe1da9fcdc06 (patch)
treea09be69c75dce6435d7584ad467aeb51e3c8d37a /xmake/tools
parentace13f7594d5dbddd771cfe0a4004bbcb506b11c (diff)
rename shellname to program
Diffstat (limited to 'xmake/tools')
-rw-r--r--xmake/tools/ar.lua10
-rw-r--r--xmake/tools/cl.lua8
-rw-r--r--xmake/tools/clang.lua4
-rw-r--r--xmake/tools/clangxx.lua4
-rw-r--r--xmake/tools/dmd.lua13
-rw-r--r--xmake/tools/gcc.lua15
-rw-r--r--xmake/tools/gccgo.lua6
-rw-r--r--xmake/tools/gdc.lua4
-rw-r--r--xmake/tools/go.lua13
-rw-r--r--xmake/tools/gxx.lua4
-rw-r--r--xmake/tools/ldc.lua4
-rw-r--r--xmake/tools/lib.lua10
-rw-r--r--xmake/tools/link.lua10
-rw-r--r--xmake/tools/ml.lua10
-rw-r--r--xmake/tools/ml64.lua4
-rw-r--r--xmake/tools/rc.lua8
-rw-r--r--xmake/tools/rustc.lua11
-rw-r--r--xmake/tools/swiftc.lua11
18 files changed, 72 insertions, 77 deletions
diff --git a/xmake/tools/ar.lua b/xmake/tools/ar.lua
index e870aa866..5a0625dfd 100644
--- a/xmake/tools/ar.lua
+++ b/xmake/tools/ar.lua
@@ -26,10 +26,10 @@
import("core.tool.compiler")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "ar"
+ _g.program = program or "ar"
-- save the tool kind
_g.kind = kind or "ar"
@@ -67,7 +67,7 @@ function linkcmd(objectfiles, targetkind, targetfile, flags)
assert(targetkind == "static")
-- make it
- return format("%s %s %s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s %s %s %s", _g.program, flags, targetfile, objectfiles)
end
-- link the library file
@@ -96,11 +96,11 @@ function extract(libraryfile, objectdir)
local olddir = os.cd(objectdir)
-- extract it
- os.run("%s -x %s", _g.shellname, libraryfile)
+ os.run("%s -x %s", _g.program, libraryfile)
-- check repeat object name
local repeats = {}
- local objectfiles = os.iorun("%s -t %s", _g.shellname, libraryfile)
+ local objectfiles = os.iorun("%s -t %s", _g.program, libraryfile)
for _, objectfile in ipairs(objectfiles:split('\n')) do
if repeats[objectfile] then
raise("object name(%s) conflicts in library: %s", objectfile, libraryfile)
diff --git a/xmake/tools/cl.lua b/xmake/tools/cl.lua
index 7781d619d..519451800 100644
--- a/xmake/tools/cl.lua
+++ b/xmake/tools/cl.lua
@@ -26,10 +26,10 @@
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "cl.exe"
+ _g.program = program or "cl.exe"
-- save kind
_g.kind = kind
@@ -231,7 +231,7 @@ end
function _compcmd1(sourcefile, objectfile, flags)
-- make it
- return format("%s -c %s -Fo%s %s", _g.shellname, flags, objectfile, sourcefile)
+ return format("%s -c %s -Fo%s %s", _g.program, flags, objectfile, sourcefile)
end
-- complie the source file
@@ -327,7 +327,7 @@ function check(flags)
io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}")
-- check it
- os.run("%s -c %s -Fo%s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s -c %s -Fo%s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/clang.lua b/xmake/tools/clang.lua
index c49fb1b02..e93533f1f 100644
--- a/xmake/tools/clang.lua
+++ b/xmake/tools/clang.lua
@@ -26,10 +26,10 @@
inherit("gcc")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "clang", kind)
+ _super.init(program or "clang", kind)
-- init shflags
_super._g.shflags = { "-dynamiclib", "-fPIC" }
diff --git a/xmake/tools/clangxx.lua b/xmake/tools/clangxx.lua
index b9545995d..b32061f75 100644
--- a/xmake/tools/clangxx.lua
+++ b/xmake/tools/clangxx.lua
@@ -26,10 +26,10 @@
inherit("clang")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "clang++", kind)
+ _super.init(program or "clang++", kind)
end
diff --git a/xmake/tools/dmd.lua b/xmake/tools/dmd.lua
index bd6b67379..620cddb9d 100644
--- a/xmake/tools/dmd.lua
+++ b/xmake/tools/dmd.lua
@@ -23,16 +23,15 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "dmd"
+ _g.program = program or "dmd"
-- save the kind
_g.kind = kind
@@ -184,7 +183,7 @@ end
function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
- return format("%s %s -of%s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s %s -of%s %s", _g.program, flags, targetfile, objectfiles)
end
-- link the target file
@@ -201,7 +200,7 @@ end
function compcmd(sourcefiles, objectfile, flags)
-- make it
- return format("%s -c %s -of%s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+ return format("%s -c %s -of%s %s", _g.program, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
end
-- complie the source file
@@ -227,9 +226,9 @@ function check(flags, trylink)
-- check it, need check compflags and linkflags
if trylink then
- os.run("%s %s -of%s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
+ os.run("%s %s -of%s %s", _g.program, ifelse(flags, flags, ""), binaryfile, sourcefile)
else
- os.run("%s -c %s -of%s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
+ os.run("%s -c %s -of%s %s", _g.program, ifelse(flags, flags, ""), binaryfile, sourcefile)
end
-- remove files
diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua
index 7044916aa..ffe73c0e9 100644
--- a/xmake/tools/gcc.lua
+++ b/xmake/tools/gcc.lua
@@ -23,17 +23,16 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
import("detect.tools.find_ccache")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "gcc"
+ _g.program = program or "gcc"
-- save the kind
_g.kind = kind
@@ -281,7 +280,7 @@ end
function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
- return format("%s -o %s %s %s", _g.shellname, targetfile, objectfiles, flags)
+ return format("%s -o %s %s %s", _g.program, targetfile, objectfiles, flags)
end
-- link the target file
@@ -304,7 +303,7 @@ function _compcmd1(sourcefile, objectfile, flags)
end
-- make it
- local command = format("%s -c %s -o %s %s", _g.shellname, flags, objectfile, sourcefile)
+ local command = format("%s -c %s -o %s %s", _g.program, flags, objectfile, sourcefile)
if ccache then
command = ccache:append(command, " ")
end
@@ -353,7 +352,7 @@ function _compile1(sourcefile, objectfile, incdepfile, flags)
local tmpfile = os.tmpfile()
-- generate it
- os.run("%s -c -MM %s -o %s %s", _g.shellname, flags or "", tmpfile, sourcefile)
+ os.run("%s -c -MM %s -o %s %s", _g.program, flags or "", tmpfile, sourcefile)
-- translate it
local results = {}
@@ -407,9 +406,9 @@ function check(flags, trylink)
-- check it, need check compflags and linkflags
if trylink then
- os.run("%s %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
+ os.run("%s %s -o %s %s", _g.program, ifelse(flags, flags, ""), binaryfile, sourcefile)
else
- os.run("%s -c %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
+ os.run("%s -c %s -o %s %s", _g.program, ifelse(flags, flags, ""), binaryfile, sourcefile)
end
-- remove files
diff --git a/xmake/tools/gccgo.lua b/xmake/tools/gccgo.lua
index 1254130d4..997820c96 100644
--- a/xmake/tools/gccgo.lua
+++ b/xmake/tools/gccgo.lua
@@ -26,10 +26,10 @@
inherit("gcc")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "gccgo", kind)
+ _super.init(program or "gccgo", kind)
end
-- check the given flags
@@ -43,7 +43,7 @@ function check(flags)
io.writefile(sourcefile, "package main\nfunc main() {\n}")
-- check it
- os.run("%s -c %s -o %s %s", _super._g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s -c %s -o %s %s", _super._g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/gdc.lua b/xmake/tools/gdc.lua
index 64b36c2b9..70f1cc807 100644
--- a/xmake/tools/gdc.lua
+++ b/xmake/tools/gdc.lua
@@ -26,10 +26,10 @@
inherit("dmd")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "gdc", kind)
+ _super.init(program or "gdc", kind)
end
diff --git a/xmake/tools/go.lua b/xmake/tools/go.lua
index 472ff84ff..dc0e80f93 100644
--- a/xmake/tools/go.lua
+++ b/xmake/tools/go.lua
@@ -23,16 +23,15 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "go"
+ _g.program = program or "go"
-- save the kind
_g.kind = kind
@@ -128,9 +127,9 @@ function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
if targetkind == "static" then
- return format("%s tool pack %s %s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s tool pack %s %s %s", _g.program, flags, targetfile, objectfiles)
else
- return format("%s tool link %s -o %s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s tool link %s -o %s %s", _g.program, flags, targetfile, objectfiles)
end
end
@@ -148,7 +147,7 @@ end
function compcmd(sourcefiles, objectfile, flags)
-- make it
- return format("%s tool compile %s -o %s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+ return format("%s tool compile %s -o %s %s", _g.program, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
end
-- complie the source file
@@ -172,7 +171,7 @@ function check(flags)
io.writefile(sourcefile, "package main\nfunc main() {\n}")
-- check it
- os.run("%s tool compile %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s tool compile %s -o %s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/gxx.lua b/xmake/tools/gxx.lua
index f37bdb05a..256b5270d 100644
--- a/xmake/tools/gxx.lua
+++ b/xmake/tools/gxx.lua
@@ -26,10 +26,10 @@
inherit("gcc")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "g++", kind)
+ _super.init(program or "g++", kind)
end
diff --git a/xmake/tools/ldc.lua b/xmake/tools/ldc.lua
index 531d319be..eb051fd3a 100644
--- a/xmake/tools/ldc.lua
+++ b/xmake/tools/ldc.lua
@@ -26,10 +26,10 @@
inherit("dmd")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- init super
- _super.init(shellname or "ldc", kind)
+ _super.init(program or "ldc", kind)
-- init shflags
_super._g.shflags = { "-shared" }
diff --git a/xmake/tools/lib.lua b/xmake/tools/lib.lua
index 7b0a851e8..a59f7d713 100644
--- a/xmake/tools/lib.lua
+++ b/xmake/tools/lib.lua
@@ -23,10 +23,10 @@
--
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "lib.exe"
+ _g.program = program or "lib.exe"
-- save the tool kind
_g.kind = kind
@@ -46,7 +46,7 @@ function extract(libraryfile, objectdir)
os.mkdir(objectdir)
-- list object files
- local objectfiles = os.iorun("%s -nologo -list %s", _g.shellname, libraryfile)
+ local objectfiles = os.iorun("%s -nologo -list %s", _g.program, libraryfile)
-- extrace all object files
for _, objectfile in ipairs(objectfiles:split('\n')) do
@@ -68,7 +68,7 @@ function extract(libraryfile, objectdir)
end
-- extract it
- os.run("%s -nologo -extract:%s -out:%s %s", _g.shellname, objectfile, outputfile, libraryfile)
+ os.run("%s -nologo -extract:%s -out:%s %s", _g.program, objectfile, outputfile, libraryfile)
end
end
end
@@ -85,7 +85,7 @@ function check(flags)
-- check it
os.run("cl -c -Fo%s %s", objfile, srcfile)
os.run("link -lib -out:%s %s", libfile, objfile)
- os.run("%s %s -list %s", _g.shellname, ifelse(flags, flags, ""), libfile)
+ os.run("%s %s -list %s", _g.program, ifelse(flags, flags, ""), libfile)
-- remove files
os.rm(objfile)
diff --git a/xmake/tools/link.lua b/xmake/tools/link.lua
index aa99377fb..c79d67a2a 100644
--- a/xmake/tools/link.lua
+++ b/xmake/tools/link.lua
@@ -26,10 +26,10 @@
import("core.project.config")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "link.exe"
+ _g.program = program or "link.exe"
-- save the tool kind
_g.kind = kind
@@ -109,13 +109,13 @@ end
function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
- local cmd = format("%s %s -out:%s %s", _g.shellname, flags, targetfile, objectfiles)
+ local cmd = format("%s %s -out:%s %s", _g.program, flags, targetfile, objectfiles)
-- too long?
if #cmd > 4096 then
local argfile = targetfile .. ".arg"
io.printf(argfile, "%s -out:%s %s", flags, targetfile, objectfiles)
- cmd = format("%s @%s", _g.shellname, argfile)
+ cmd = format("%s @%s", _g.program, argfile)
end
-- ok?
@@ -154,7 +154,7 @@ function check(flags)
-- check it
os.run("cl -c -Fo%s %s", objectfile, sourcefile)
- os.run("%s %s -out:%s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, objectfile)
+ os.run("%s %s -out:%s %s", _g.program, ifelse(flags, flags, ""), binaryfile, objectfile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/ml.lua b/xmake/tools/ml.lua
index d8ddaee29..709f81d58 100644
--- a/xmake/tools/ml.lua
+++ b/xmake/tools/ml.lua
@@ -23,16 +23,16 @@
--
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save name
- _g.shellname = shellname or "ml.exe"
+ _g.program = program or "ml.exe"
-- save kind
_g.kind = kind
-- init asflags
- if _g.shellname:find("64") then
+ if _g.program:find("64") then
_g.asflags = { "-nologo"}
else
_g.asflags = { "-nologo", "-Gd"}
@@ -114,7 +114,7 @@ end
function _compcmd1(sourcefile, objectfile, flags)
-- make it
- return format("%s -c %s -Fo%s %s", _g.shellname, flags, objectfile, sourcefile)
+ return format("%s -c %s -Fo%s %s", _g.program, flags, objectfile, sourcefile)
end
-- complie the source file
@@ -155,7 +155,7 @@ function check(flags)
io.writefile(sourcefile, "end")
-- check it
- os.run("%s -c %s -Fo%s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s -c %s -Fo%s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/ml64.lua b/xmake/tools/ml64.lua
index be4bb0dc8..f21e5466e 100644
--- a/xmake/tools/ml64.lua
+++ b/xmake/tools/ml64.lua
@@ -26,7 +26,7 @@
inherit("ml")
-- init it
-function init(shellname, kind)
- _super.init(shellname or "ml64", kind)
+function init(program, kind)
+ _super.init(program or "ml64", kind)
end
diff --git a/xmake/tools/rc.lua b/xmake/tools/rc.lua
index eb2d5fa05..f64651d8c 100644
--- a/xmake/tools/rc.lua
+++ b/xmake/tools/rc.lua
@@ -27,10 +27,10 @@ import("core.base.option")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "rc.exe"
+ _g.program = program or "rc.exe"
-- save kind
_g.kind = kind
@@ -74,7 +74,7 @@ end
function _compcmd1(sourcefile, objectfile, flags)
-- make it
- return format("%s %s -Fo%s %s", _g.shellname, flags, objectfile, sourcefile)
+ return format("%s %s -Fo%s %s", _g.program, flags, objectfile, sourcefile)
end
-- complie the source file
@@ -140,7 +140,7 @@ function check(flags)
io.writefile(sourcefile, "#define RESID 1")
-- check it
- os.run("%s -fo%s %s", _g.shellname, objectfile, sourcefile)
+ os.run("%s -fo%s %s", _g.program, objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/rustc.lua b/xmake/tools/rustc.lua
index 44e117d3f..df261545a 100644
--- a/xmake/tools/rustc.lua
+++ b/xmake/tools/rustc.lua
@@ -23,16 +23,15 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "rustc"
+ _g.program = program or "rustc"
-- save the kind
_g.kind = kind
@@ -110,7 +109,7 @@ end
function buildcmd(sourcefiles, targetkind, targetfile, flags)
-- make it
- return format("%s %s -o %s %s", _g.shellname, flags, targetfile, table.concat(sourcefiles, " "))
+ return format("%s %s -o %s %s", _g.program, flags, targetfile, table.concat(sourcefiles, " "))
end
-- build the target file
@@ -127,7 +126,7 @@ end
function compcmd(sourcefiles, objectfile, flags)
-- make it
- return format("%s --emit obj %s -o %s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+ return format("%s --emit obj %s -o %s %s", _g.program, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
end
-- complie the source file
@@ -151,7 +150,7 @@ function check(flags)
io.writefile(sourcefile, "fn main() {\n}")
-- check it
- os.run("%s --emit obj %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s --emit obj %s -o %s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)
diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua
index ebae6b28f..b740a49a9 100644
--- a/xmake/tools/swiftc.lua
+++ b/xmake/tools/swiftc.lua
@@ -23,15 +23,14 @@
--
-- imports
-import("core.tool.tool")
import("core.project.config")
import("detect.tools.find_ccache")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "swiftc"
+ _g.program = program or "swiftc"
-- init kind
_g.kind = kind
@@ -205,7 +204,7 @@ end
function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
- return format("%s -o %s %s %s", _g.shellname, targetfile, objectfiles, flags)
+ return format("%s -o %s %s %s", _g.program, targetfile, objectfiles, flags)
end
-- link the target file
@@ -228,7 +227,7 @@ function _compcmd1(sourcefile, objectfile, flags)
end
-- make it
- local command = format("%s -c %s -o %s %s", _g.shellname, flags, objectfile, sourcefile)
+ local command = format("%s -c %s -o %s %s", _g.program, flags, objectfile, sourcefile)
if ccache then
command = ccache:append(command, " ")
end
@@ -271,5 +270,5 @@ end
function check(flags)
-- check it
- os.run("%s -h", _g.shellname)
+ os.run("%s -h", _g.program)
end