Skip to content

Commit

Permalink
reformat mode for makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 9, 2016
1 parent dfd8d8b commit ed7b306
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions xmake/scripts/base/makefile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ function makefile._make_object_for_object(file, target, srcfile, objfile)
if filetype ~= ".o" and filetype ~= ".obj" then return false end

-- get mode
local mode = config.get("mode") or ""
if mode == "release" then mode = ".r"
elseif mode == "debug" then mode = ".d"
elseif mode == "profile" then mode = ".p"
else mode = "" end
local mode = config.get("mode")
if mode then
mode = "." .. mode
else
mode = ""
end

-- make command
local cmd = string.format("xmake l cp %s %s", srcfile, objfile)
Expand Down Expand Up @@ -91,11 +92,12 @@ function makefile._make_object_for_static(file, target, srcfile, objfile)
if filetype ~= ".a" and filetype ~= ".lib" then return false end

-- get mode
local mode = config.get("mode") or ""
if mode == "release" then mode = ".r"
elseif mode == "debug" then mode = ".d"
elseif mode == "profile" then mode = ".p"
else mode = "" end
local mode = config.get("mode")
if mode then
mode = "." .. mode
else
mode = ""
end

-- make command
local cmd = string.format("xmake l -P %s -f %s dispatcher ex extract %s %s > %s 2>&1", xmake._PROJECT_DIR, xmake._PROJECT_FILE, srcfile:encode(), objfile:encode(), makefile._LOGFILE)
Expand Down Expand Up @@ -141,11 +143,12 @@ function makefile._make_object(file, target, srcfile, objfile)
end

-- get mode
local mode = config.get("mode") or ""
if mode == "release" then mode = ".r"
elseif mode == "debug" then mode = ".d"
elseif mode == "profile" then mode = ".p"
else mode = "" end
local mode = config.get("mode")
if mode then
mode = "." .. mode
else
mode = ""
end

-- get ccache
local ccache = platform.tool("ccache")
Expand Down Expand Up @@ -263,11 +266,12 @@ function makefile._make_target(file, name, target)
file:write("\n")

-- get mode
local mode = config.get("mode") or ""
if mode == "release" then mode = ".r"
elseif mode == "debug" then mode = ".d"
elseif mode == "profile" then mode = ".p"
else mode = "" end
local mode = config.get("mode")
if mode then
mode = "." .. mode
else
mode = ""
end

-- make the command
local cmd = linker.make(l, target, srcfiles, objfiles, targetfile, makefile._LOGFILE)
Expand Down

0 comments on commit ed7b306

Please sign in to comment.