From bed6d56ecc21d4c1c4c706d435c1ebc4e93b88ce Mon Sep 17 00:00:00 2001 From: arookas Date: Sat, 12 Dec 2015 17:41:54 -0500 Subject: [PATCH] Added premake5 configuration. --- .gitignore | 4 +++ premake5.lua | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 premake5.lua diff --git a/.gitignore b/.gitignore index 5790e94..afb1861 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# premake +premake5.bat +premake5.exe + # visual studio *.csproj *.user diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 0000000..aeb6b6f --- /dev/null +++ b/premake5.lua @@ -0,0 +1,70 @@ +workspace "ssc" + configurations { "Debug", "Release" } + targetdir "bin/%{cfg.buildcfg}" + + startproject "frontend" + + filter "configurations:Debug" + defines { "DEBUG" } + flags { "Symbols" } + + filter "configurations:Release" + defines { "RELEASE" } + optimize "On" + + -- sunscript compiler API library + project "ssc" + kind "SharedLib" + language "C#" + namespace "arookas" + location "ssc" + + links { "System", "arookas", "grammatica-1.6" } + + files + { + "ssc/**.cs", + "ssc/**.grammar", + "ssc/**.bat", + } + + excludes + { + "ssc/bin/**", + "ssc/obj/**", + } + + prebuildcommands + { + -- regenerate grammatica classes before compilation begins + "{CHDIR} \"%{prj.location}\"", + "java -jar grammatica.jar \"sunscript.grammar\" --csoutput \".\\generated\" --csnamespace \"arookas\" --csclassname \"__sun\"", + } + + -- frontend project (example command-line interface) + project "frontend" + kind "ConsoleApp" + language "C#" + entrypoint "arookas.SSC" + namespace "arookas" + location "frontend" + + links { "System", "arookas", "SSC" } + + files + { + "frontend/**.cs", + } + + excludes + { + "frontend/bin/**", + "frontend/obj/**", + } + + postbuildcommands + { + -- copy stdlib to frontend output so users can import the scripts + "{RMDIR} \"%{cfg.buildtarget.directory}ssc\"", + "{COPY} \"%{wks.location}stdlib\" \"%{cfg.buildtarget.directory}ssc\"", + }