diff options
| author | ruki <[email protected]> | 2016-03-21 20:57:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-03-21 20:57:37 +0800 |
| commit | b898400a3a5f18d332ce7ef159769d8f17fd28e5 (patch) | |
| tree | 275f124aa7c17c6090d25fefb226b0678f6d231d /xmake/actions | |
| parent | f0623bf26279430deb6799b7816fb61996120166 (diff) | |
add project option
Diffstat (limited to 'xmake/actions')
| -rwxr-xr-x | xmake/actions/config/makefile.lua | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/xmake/actions/config/makefile.lua b/xmake/actions/config/makefile.lua index 6f2f60771..293fb45c0 100755 --- a/xmake/actions/config/makefile.lua +++ b/xmake/actions/config/makefile.lua @@ -23,6 +23,13 @@ -- imports import("core.project.project") +-- get log file +function _logfile() + + -- get it + return vformat("$(buildir)/.build.log") +end + -- make the object function _make_object(makefile, target, srcfile, objfile) @@ -47,14 +54,6 @@ end -- make target function _make_target(makefile, target) ---[[ -- get the linker from the given kind - local l = linker.get(target.kind) - if not l then - utils.error("cannot get linker with kind: %s", target.kind) - return false - end -]] - -- make head local targetfile = target:targetfile() makefile:printf("%s: %s\n", name, targetfile) @@ -77,13 +76,13 @@ function _make_target(makefile, target) makefile:print("") -- make the command - local srcfiles = target:sourcefiles() - local cmd = ""--linker.make(l, target, srcfiles, objfiles, targetfile, makefile._LOGFILE) + local linker = target:linker() + local cmd = linker:makecmd(target, objfiles, targetfile, _logfile()) -- make the verbose info local verbose = cmd:encode() if verbose and #verbose > 256 then - verbose = nil--linker.make(l, target, srcfiles, {rule.filename("*", "object")}, targetfile) + verbose = linker:makecmd(target, {target.filename("*", "object")}, targetfile) verbose = verbose:encode() end @@ -110,7 +109,7 @@ function _make_target(makefile, target) makefile:print("") -- make objects for this target - _make_objects(makefile, target, srcfiles, objfiles) + _make_objects(makefile, target, target:sourcefiles(), objfiles) end @@ -145,7 +144,7 @@ function make() os.cd("$(projectdir)") -- remove the log file first - os.rm("$(buildir)/.build.log") + os.rm(_logfile()) -- open the makefile local makefile = io.open("$(buildir)/makefile", "w") |
