diff --git a/modules/gmake2/gmake2.lua b/modules/gmake2/gmake2.lua index 3b52fda4..523693e4 100644 --- a/modules/gmake2/gmake2.lua +++ b/modules/gmake2/gmake2.lua @@ -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")) diff --git a/modules/gmake2/gmake2_cpp.lua b/modules/gmake2/gmake2_cpp.lua index 91497c48..7826a59e 100644 --- a/modules/gmake2/gmake2_cpp.lua +++ b/modules/gmake2/gmake2_cpp.lua @@ -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) diff --git a/modules/gmake2/gmake2_csharp.lua b/modules/gmake2/gmake2_csharp.lua index ddb217a4..812d3b66 100644 --- a/modules/gmake2/gmake2_csharp.lua +++ b/modules/gmake2/gmake2_csharp.lua @@ -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 diff --git a/modules/gmake2/gmake2_utility.lua b/modules/gmake2/gmake2_utility.lua index 376b088d..8cf430cb 100644 --- a/modules/gmake2/gmake2_utility.lua +++ b/modules/gmake2/gmake2_utility.lua @@ -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 diff --git a/modules/gmake2/gmake2_workspace.lua b/modules/gmake2/gmake2_workspace.lua index 22c67b0f..7b310a09 100644 --- a/modules/gmake2/gmake2_workspace.lua +++ b/modules/gmake2/gmake2_workspace.lua @@ -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) diff --git a/modules/gmake2/tests/test_gmake2_target_rules.lua b/modules/gmake2/tests/test_gmake2_target_rules.lua index 801c7563..8f28769b 100644 --- a/modules/gmake2/tests/test_gmake2_target_rules.lua +++ b/modules/gmake2/tests/test_gmake2_target_rules.lua @@ -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: