A few fixes from our Blizzard Fork.

This commit is contained in:
Tom van Dijck 2017-06-13 10:26:04 -07:00
parent 230efba691
commit 0a442f78ca
6 changed files with 14 additions and 12 deletions

View File

@ -151,7 +151,7 @@
if #result then
result = result .. " "
end
result = result .. pregmake2.quoted(v)
result = result .. p.quoted(v)
end
return result
else
@ -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"))

View File

@ -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
@ -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('')
@ -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 "$@"')
@ -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)

View File

@ -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)
@ -178,7 +178,7 @@
end
function gmake2.cs.getresponsefilename(prj)
function cs.getresponsefilename(prj)
return '$(OBJDIR)/' .. prj.filename .. '.rsp'
end

View File

@ -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

View File

@ -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)

View File

@ -36,7 +36,7 @@
function suite.defaultRules()
prepare()
test.capture [[
all: $(TARGET) | $(TARGETDIR) $(OBJDIR) prebuild prelink
all: prebuild prelink $(TARGET) | $(TARGETDIR) $(OBJDIR)
@:
]]
end
@ -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: