diff options
| author | ruki <[email protected]> | 2016-07-09 22:34:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-09 22:34:16 +0800 |
| commit | f54223a97ba93b02128df84d52d3efe7abd2a36a (patch) | |
| tree | b6d5e5d1b4d70bd1eeadf936751eb50930f3bab6 /xmake/plugins/project/makefile.lua | |
| parent | 0d3075a0739eff0e28db11889a62ed3db8f4ab9f (diff) | |
add archiver and extractor
Diffstat (limited to 'xmake/plugins/project/makefile.lua')
| -rwxr-xr-x | xmake/plugins/project/makefile.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/plugins/project/makefile.lua b/xmake/plugins/project/makefile.lua index 405441368..7620293ae 100755 --- a/xmake/plugins/project/makefile.lua +++ b/xmake/plugins/project/makefile.lua @@ -23,6 +23,7 @@ -- imports import("core.tool.tool") import("core.tool.linker") +import("core.tool.archiver") import("core.tool.compiler") import("core.project.project") @@ -79,9 +80,6 @@ function _make_object(makefile, target, srcfile, objfile) -- make command local ccache = tool.shellname("ccache") local command = compiler.compcmd(srcfile, objfile, target) - if ccache then - command = ccache:append(command, " ") - end -- make head makefile:printf("%s:", objfile) @@ -140,7 +138,12 @@ function _make_target(makefile, target) makefile:print("") -- make the command - local command = linker.linkcmd(target:objectfiles(), targetfile, target) + local command = nil + if target:get("kind") == "static" then + command = archiver.archivecmd(target:objectfiles(), targetfile, target) + else + command = linker.linkcmd(target:objectfiles(), targetfile, target) + end -- make body makefile:print("\t@echo linking.$(mode) %s", path.filename(targetfile)) @@ -212,5 +215,4 @@ function make(outputfile) -- leave project directory os.cd(olddir) - end |
