Skip to content

Commit

Permalink
Fix gmake2 (#169)
Browse files Browse the repository at this point in the history
bindirs are added to make files for gmake2
  • Loading branch information
Sungun Park authored and TurkeyMan committed Jun 5, 2018
1 parent ff732af commit 9219bd6
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions modules/gmake2/gmake2_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@

utility.elements.configuration = function(cfg)
return {
utility.bindirs,
utility.exepaths,
gmake2.settings,
gmake2.preBuildCmds,
gmake2.preLinkCmds,
Expand All @@ -247,6 +249,21 @@
end


function utility.bindirs(cfg, toolset)
local dirs = project.getrelative(cfg.project, cfg.bindirs)
if #dirs > 0 then
p.outln('EXECUTABLE_PATHS = "' .. table.concat(dirs, ":") .. '"')
end
end


function utility.exepaths(cfg, toolset)
local dirs = project.getrelative(cfg.project, cfg.bindirs)
if #dirs > 0 then
p.outln('EXE_PATHS = PATH=$(EXECUTABLE_PATHS):$$PATH;')
end
end


--
-- Write out the file sets.
Expand Down Expand Up @@ -365,7 +382,7 @@
function utility.outputFileRules(cfg, file)
local outputs = table.concat(file.buildoutputs, ' ')

local dependencies = file.source
local dependencies = p.esc(file.source)
if file.buildinputs and #file.buildinputs > 0 then
dependencies = dependencies .. " " .. table.concat(p.esc(file.buildinputs), " ")
end
Expand All @@ -379,7 +396,11 @@
if file.buildcommands then
local cmds = os.translateCommandsAndPaths(file.buildcommands, cfg.project.basedir, cfg.project.location)
for _, cmd in ipairs(cmds) do
_p('\t$(SILENT) %s', cmd)
if cfg.bindirs and #cfg.bindirs > 0 then
_p('\t$(SILENT) $(EXE_PATHS) %s', cmd)
else
_p('\t$(SILENT) %s', cmd)
end
end
end
end

0 comments on commit 9219bd6

Please sign in to comment.