Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New to Premake? You might want to start with What is Premake?
If you don't have Premake already, see Getting Premake to learn how.
Premake is a small command line executable, delivered as a single file. Just unpack the download and place the executable on your system search path, or anywhere else convenient.
Using Premake to Generate Project Files
The simplest Premake command is:
Premake defines the following list of actions out of the box; projects may also add their own custom actions.
|vs2017||Generate Visual Studio 2017 project files|
|vs2015||Generate Visual Studio 2015 project files|
|vs2013||Generate Visual Studio 2013 project files|
|vs2012||Generate Visual Studio 2012 project files|
|vs2010||Generate Visual Studio 2010 project files|
|vs2008||Generate Visual Studio 2008 project files|
|vs2005||Generate Visual Studio 2005 project files|
|gmake||Generate GNU Makefiles (including Cygwin and MinGW)|
|xcode4||XCode projects (built-in extension)|
|codelite||CodeLite projects (built-in extension)|
(Premake4 supported some additional actions that haven't yet been ported to this new version; see the Available Feature Matrix for the whole list.)
To generate Visual Studio 2013 project files, use the command:
You can see a complete list of the actions and other options supported by a project with the command:
Using the Generated Projects
For toolsets like Visual Studio and Xcode, you can simply load the generated workspace or workspace into your IDE and build as you normally would.
If you have generated makefiles, running make with no options will build all targets using the default configuration, as set by the project author. To see the list of available configurations, type:
To build a different configuration, add the config argument:
To remove all generated binaries and intermediate files:
make clean # to clean the default target make config=release clean # to clean a different target
Premake generated makefiles do not (currently) support a make install step. Instead, project owners are encouraged to add an install action to their Premake scripts, which has the advantage of working with any toolset on any platform. You can check for the existence of an install action by viewing the help (run premake5 --help in the project directory).