2008-10-31 18:38:05 +00:00
|
|
|
PREMAKE BUILD INSTRUCTIONS
|
|
|
|
|
|
|
|
As of version 4.0, Premake is written in a mix of C and Lua. This mix
|
2008-12-30 01:29:15 +00:00
|
|
|
enables many new features, but it makes building Premake a bit more
|
|
|
|
complicated.
|
|
|
|
|
|
|
|
If you downloaded a source code package from SourceForge, you will
|
|
|
|
find project files for Visual Studio, Code::Blocks, CodeLite, and
|
|
|
|
GNU make in the build/ directory. Build the release configuration
|
|
|
|
(the default for the makefiles) and you will find the executable in
|
|
|
|
bin/release ready to go.
|
|
|
|
|
|
|
|
If you want to use a debug build instead, or if you downloaded the
|
|
|
|
source code from Subversion instead of a SourceForge release, read
|
|
|
|
the next section for more information.
|
|
|
|
|
|
|
|
Visual Studio 2002 and 2003 users: these version of Visual Studio
|
|
|
|
are unable to build Premake due to string size limitations. Use one
|
|
|
|
the newer, free versions of Visual Studio C++ Express instead.
|
|
|
|
|
|
|
|
If you find all of this very confusing and need some help, see the
|
|
|
|
end of this document for contact information.
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
GENERATING THE PROJECT FILES
|
|
|
|
|
|
|
|
If you downloaded a source code package from SourceForge, the project
|
2008-12-29 23:20:44 +00:00
|
|
|
files are already included (in build/) and you can skip ahead to the
|
|
|
|
next section. If you downloaded the sources from Subversion, you'll
|
|
|
|
need to generate new projects files before you can build.
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
In order to generate the project files, you need a working version of
|
|
|
|
Premake, either 3.x or 4.x versions, installed on your system. You can
|
|
|
|
get it as source code or a prebuilt binary from the SourceForge
|
|
|
|
download page.
|
|
|
|
|
2008-12-30 01:29:15 +00:00
|
|
|
Once you have a working Premake installed, use it to generate the
|
|
|
|
project files. For Premake 4.x, type a command like:
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
premake4 gmake -- for GNU makefiles using GCC
|
|
|
|
premake4 vs2005 -- for a Visual Studio 2005 solution
|
|
|
|
|
|
|
|
For Premake 3.x, use the old command line format:
|
|
|
|
|
|
|
|
premake --target gnu
|
|
|
|
premake --target vs2005
|
|
|
|
|
2008-12-29 23:20:44 +00:00
|
|
|
Use the "--help" option to see all of the available targets.
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
RELEASE AND DEBUG BUILDS
|
|
|
|
|
|
|
|
Premake can be built in either "release" or "debug" modes. You can
|
2008-12-29 23:20:44 +00:00
|
|
|
choose which configuration to build with the "config" argument:
|
2008-10-31 18:38:05 +00:00
|
|
|
|
2008-12-29 23:20:44 +00:00
|
|
|
make config=debug -- build in debug mode
|
|
|
|
make config=release -- build in release mode
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
(IDEs like Visual Studio provide their own mechanism for switching
|
2008-12-30 01:29:15 +00:00
|
|
|
build configurations).
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
In release mode (the default) you can build and run Premake like any
|
|
|
|
other C application. In debug mode, Premake reads the Lua scripts from
|
|
|
|
the disk at runtime, enabling compile-less code/test iterations. But
|
|
|
|
it needs some help to find the scripts.
|
|
|
|
|
2008-12-29 23:20:44 +00:00
|
|
|
You can specify the location of the scripts in one of two ways: using
|
|
|
|
the /scripts command line argument, like so:
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
premake4 /scripts=~/Code/premake4/src gmake
|
|
|
|
|
|
|
|
Or by setting a PREMAKE_PATH environment variable.
|
|
|
|
|
|
|
|
PREMAKE_PATH=~/Code/premake4/src
|
|
|
|
|
|
|
|
As you can see, you need to specify the location of the Premake "src"
|
|
|
|
directory, the one containing "_premake_main.lua".
|
|
|
|
|
|
|
|
|
2009-01-19 01:45:47 +00:00
|
|
|
EMBEDDING SCRIPTS
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
If you make changes to the core Lua scripts, you can integrate them
|
2009-01-19 01:45:47 +00:00
|
|
|
into the release build using the "embed" command:
|
2008-10-31 18:38:05 +00:00
|
|
|
|
2009-01-19 01:45:47 +00:00
|
|
|
premake4 embed
|
2008-10-31 18:38:05 +00:00
|
|
|
|
2009-01-19 01:45:47 +00:00
|
|
|
This command embeds all of the scripts listed in _manifest.lua into
|
|
|
|
src/host/scripts.c as static strings. The next release build will
|
|
|
|
include the updated scripts.
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
CONFUSED?
|
|
|
|
|
|
|
|
I'll be glad to help you out. Stop by the main project website where
|
2008-12-29 23:20:44 +00:00
|
|
|
you can leave a note in the forums (the preferred approach), join the
|
2008-10-31 18:38:05 +00:00
|
|
|
mailing list, or contact me directly.
|
|
|
|
|
|
|
|
http://industriousone.com/premake
|
2008-12-29 23:20:44 +00:00
|
|
|
|
|
|
|
Enjoy!
|
|
|
|
|