diff options
Diffstat (limited to 'src/actions/make/_make.lua')
-rw-r--r-- | src/actions/make/_make.lua | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/actions/make/_make.lua b/src/actions/make/_make.lua index 0bf80f6..13facf2 100644 --- a/src/actions/make/_make.lua +++ b/src/actions/make/_make.lua @@ -26,13 +26,13 @@ result = result:gsub(" ", "\\ ") result = result:gsub("%(", "\\%(") result = result:gsub("%)", "\\%)") - + -- leave $(...) shell replacement sequences alone result = result:gsub("$\\%((.-)\\%)", "$%(%1%)") return result end end - + -- @@ -59,8 +59,20 @@ _p('endif') _p('') end - - + + +-- +-- Format a list of values to be safely written as part of a variable assignment. +-- + + function make.list(value) + if #value > 0 then + return " " .. table.concat(value, " ") + else + return "" + end + end + -- -- Get the makefile file name for a solution or a project. If this object is the @@ -79,14 +91,14 @@ end end end - + if (count == 1) then return "Makefile" else return this.name .. ".make" end end - + -- -- Returns a list of object names, properly escaped to be included in the makefile. @@ -99,7 +111,7 @@ end return result end - + -- @@ -112,7 +124,7 @@ _p(value) end end - + local toolsettings = cc.platforms[cfg.platform].cfgsettings if toolsettings then _p(toolsettings) @@ -128,20 +140,20 @@ trigger = "gmake", shortname = "GNU Make", description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin", - + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, - + valid_languages = { "C", "C++", "C#" }, - + valid_tools = { cc = { "gcc" }, dotnet = { "mono", "msnet", "pnet" }, }, - + onsolution = function(sln) premake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution) end, - + onproject = function(prj) local makefile = _MAKE.getmakefilename(prj, true) if premake.isdotnetproject(prj) then @@ -150,11 +162,11 @@ premake.generate(prj, makefile, premake.make_cpp) end end, - + oncleansolution = function(sln) premake.clean.file(sln, _MAKE.getmakefilename(sln, false)) end, - + oncleanproject = function(prj) premake.clean.file(prj, _MAKE.getmakefilename(prj, true)) end |