Skip to content

Commit

Permalink
A few fixes from our Blizzard Fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom van Dijck committed Jun 13, 2017
1 parent 230efba commit 0a442f7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions modules/gmake2/gmake2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
if #result then
result = result .. " "
end
result = result .. pregmake2.quoted(v)
result = result .. p.quoted(v)
end
return result
else
Expand Down Expand Up @@ -302,7 +302,7 @@
local steps = cfg[event .. "commands"]
local msg = cfg[event .. "message"]
if #steps > 0 then
steps = os.translateCommands(steps)
steps = os.translateCommandsAndPaths(steps, cfg.project.basedir, cfg.project.location)
msg = msg or string.format("Running %s commands", event)
_p('\t@echo %s', msg)
_p('\t%s', table.implode(steps, "", "", "\n\t"))
Expand Down
10 changes: 5 additions & 5 deletions modules/gmake2/gmake2_cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
-- $(LDFLAGS) moved to end (http://sourceforge.net/p/premake/patches/107/)
-- $(LIBS) moved to end (http://sourceforge.net/p/premake/bugs/279/)

local cc = iif(cfg.language == "C", "CC", "CXX")
local cc = iif(p.languages.isc(cfg.language), "CC", "CXX")
p.outln('LINKCMD = $(' .. cc .. ') -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)')
end
end
Expand Down Expand Up @@ -659,13 +659,13 @@

function cpp.allRules(cfg, toolset)
if cfg.system == p.MACOSX and cfg.kind == p.WINDOWEDAPP then
_p('all: $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist | $(TARGETDIR) $(OBJDIR) prebuild prelink')
_p('all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist | $(TARGETDIR) $(OBJDIR)')
_p('\t@:')
_p('')
_p('$(dir $(TARGETDIR))PkgInfo:')
_p('$(dir $(TARGETDIR))Info.plist:')
else
_p('all: $(TARGET) | $(TARGETDIR) $(OBJDIR) prebuild prelink')
_p('all: prebuild prelink $(TARGET) | $(TARGETDIR) $(OBJDIR)')
_p('\t@:')
end
_p('')
Expand Down Expand Up @@ -713,7 +713,7 @@
_p('$(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) $(PCH_PLACEHOLDER)')
_p('$(GCH): $(PCH) | $(OBJDIR)')
_p('\t@echo $(notdir $<)')
local cmd = iif(cfg.language == "C", "$(CC) -x c-header $(ALL_CFLAGS)", "$(CXX) -x c++-header $(ALL_CXXFLAGS)")
local cmd = iif(p.languages.isc(cfg.language), "$(CC) -x c-header $(ALL_CFLAGS)", "$(CXX) -x c++-header $(ALL_CXXFLAGS)")
_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.gch=%%.d)" -c "$<"', cmd)
_p('$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)')
_p('\t$(SILENT) touch "$@"')
Expand Down Expand Up @@ -761,7 +761,7 @@
end

if file.buildcommands then
local cmds = os.translateCommands(file.buildcommands)
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)
Expand Down
4 changes: 2 additions & 2 deletions modules/gmake2/gmake2_csharp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
-- Generate a GNU make C# project makefile, with support for the new platforms API.
--

function gmake2.cs.generate(prj)
function cs.generate(prj)
p.eol("\n")
local toolset = p.tools.dotnet
p.callArray(cs.elements.makefile, prj, toolset)
Expand Down Expand Up @@ -178,7 +178,7 @@
end


function gmake2.cs.getresponsefilename(prj)
function cs.getresponsefilename(prj)
return '$(OBJDIR)/' .. prj.filename .. '.rsp'
end

Expand Down
2 changes: 1 addition & 1 deletion modules/gmake2/gmake2_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
end

if file.buildcommands then
local cmds = os.translateCommands(file.buildcommands)
local cmds = os.translateCommandsAndPaths(file.buildcommands, cfg.project.basedir, cfg.project.location)
for _, cmd in ipairs(cmds) do
_p('\t$(SILENT) %s', cmd)
end
Expand Down
2 changes: 2 additions & 0 deletions modules/gmake2/gmake2_workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@
end
end
if #groupTargets > 0 then
table.sort(groupTargets)
rule = rule .. " " .. table.concat(groupTargets, " ")
end
if #projectTargets > 0 then
table.sort(projectTargets)
rule = rule .. " " .. table.concat(projectTargets, " ")
end
_p(rule)
Expand Down
4 changes: 2 additions & 2 deletions modules/gmake2/tests/test_gmake2_target_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
function suite.defaultRules()
prepare()
test.capture [[
all: $(TARGET) | $(TARGETDIR) $(OBJDIR) prebuild prelink
all: prebuild prelink $(TARGET) | $(TARGETDIR) $(OBJDIR)
@:
]]
end
Expand All @@ -51,7 +51,7 @@ all: $(TARGET) | $(TARGETDIR) $(OBJDIR) prebuild prelink
kind "WindowedApp"
prepare()
test.capture [[
all: $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist | $(TARGETDIR) $(OBJDIR) prebuild prelink
all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist | $(TARGETDIR) $(OBJDIR)
@:
$(dir $(TARGETDIR))PkgInfo:
Expand Down

0 comments on commit 0a442f7

Please sign in to comment.