This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/modules/gmake2/_preload.lua

68 lines
1.8 KiB
Lua
Raw Normal View History

2017-06-13 16:51:58 +00:00
--
-- Name: gmake2/_preload.lua
-- Purpose: Define the gmake2 action.
-- Author: Blizzard Entertainment (Tom van Dijck)
-- Modified by: Aleksi Juvani
-- Vlad Ivanov
-- Created: 2016/01/01
-- Copyright: (c) 2016-2017 Jason Perkins, Blizzard Entertainment and the Premake project
--
local p = premake
newaction {
trigger = "gmake2",
shortname = "Alternative GNU Make",
description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "clang", "gcc" },
dotnet = { "mono", "msnet", "pnet" }
},
onInitialize = function()
p.modules.gmake2.cpp.initialize()
end,
onWorkspace = function(wks)
p.escaper(p.modules.gmake2.esc)
p.generate(wks, p.modules.gmake2.getmakefilename(wks, false), p.modules.gmake2.generate_workspace)
end,
onProject = function(prj)
p.escaper(p.modules.gmake2.esc)
local makefile = p.modules.gmake2.getmakefilename(prj, true)
if prj.kind == p.UTILITY then
p.generate(prj, makefile, p.modules.gmake2.utility.generate)
elseif prj.kind == p.MAKEFILE then
p.generate(prj, makefile, p.modules.gmake2.makefile.generate)
else
if project.isdotnet(prj) then
p.generate(prj, makefile, p.modules.gmake2.cs.generate)
elseif project.iscpp(prj) then
p.generate(prj, makefile, p.modules.gmake2.cpp.generate)
end
end
end,
onCleanWorkspace = function(wks)
p.clean.file(wks, p.modules.gmake2.getmakefilename(wks, false))
end,
onCleanProject = function(prj)
p.clean.file(prj, p.modules.gmake2.getmakefilename(prj, true))
end
}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return (_ACTION == "gmake2")
end