Fix gmake2
bindirs are added to make files for gmake2
utility.elements.configuration = function(cfg)
return {
+ utility.bindirs,
+ utility.exepaths,
gmake2.settings,
gmake2.preBuildCmds,
gmake2.preLinkCmds,
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.
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
if file.buildcommands then
local cmds = os.translateCommandsAndPaths(file.buildcommands, cfg.project.basedir, cfg.project.location)
for _, cmd in ipairs(cmds) do
+ 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
