A new version is available!
Premake 4.0 is now available at our new website.
This page describes Premake 3.7, the last release in the 3.x series.
Premake uses three types of structures to describe a software project: “project”, “package”, and “configuration”. At the top level is a project, which encompasses all of the code inputs and binary outputs.
A package represents a binary build target, like an executable or a shared library. Packages contain a list of source code files along with the information necessary to convert them into a binary output.
A project groups multiple packages together into…well, a project. A Premake project is synomymous with a Visual Studio “solution” or “workspace” (or whatever the term-of-the-day happens to be).
A configuration represents a type of build; the most common are “debug” and “release” builds. Different configurations can use different build and link flags, but always work on the same set of source code files. Premake provides “Debug” and “Release” configurations by default, but you are free to modify these or create your own.
A Premake script is typically called premake.lua. I usually create one script for the project, and then a separate script for each package but you can organize things in any way you like.
Because Premake is intended as a cross-platform tool, all file paths should use the forward slash (‘/’) as a directory separator. Premake will translate to the appropriate separator for the target platform.