Bootstrapping/Building

Overview

JamPlus comes with some simple makefiles to bootstrap the initial build of the JamPlus executable. A good portion of the makefile contents in Makefile.Common are shared between the Visual C++ NMake-based build and the GCC-based make build.

Binaries are built into a platform specific directory under the bin/ directory, such as bin/ntx86/ or bin/macosx/. All associated scripts and Lua binaries are also within this platform directory. In doing this, multiple JamPlus platform binaries can be deployed within the same directory tree, making it easy to check into your source control system.

In order to build a fully working JamPlus directory, certain LuaPlus binaries are required. By setting the environment variable LUA_BIN to the directory containing the LuaPlus binaries, the build processes described below will automatically populate the JamPlus bin/ directory with the LuaPlus binaries.

Building for Visual C++

The Visual C++ build uses Visual Studio's Link Time Code Generation support to create a highly optimized executable.

In order to build JamPlus using the Visual C++ compiler, do the following:

    cd src
    jmake

When finished, the Jam executable will have been built as bin/ntx86/jam.exe

Alternatively, a Visual Studio 2008 solution and project file is maintained. Open src/jam.VS2008.sln to build within the IDE. Note: When using the standard Visual Studio 2008 Release build, the Jam executable is nowhere near as fast as the command-line generated Link Time Code Generated version.

To clean the Visual C++ build, run:

    cd src
    clean

Building for Mac OS X

In order to build JamPlus on Mac OS X, do the following:

    cd src
    make macosx

When finished, the Jam executable will have been built as bin/macosxx64/jam.

Alternatively, an Xcode project for debugging Jam is maintained. Open src/jam.xcodeproj to build within Xcode. Please note that the Release build does not currently work. Build a Release build using the makefile instructions above.

Building for Mac OS X

In order to build JamPlus on Linux, do the following:

    cd src
    make linux

When finished, the Jam executable will have been built as bin/linuxx86/jam.

Building and Copying the LuaPlus Binaries

Grab the LuaPlus source code. One way of doing so is by cloning the LuaPlus Git repository:

    git clone http://git.luaplus.org/luaplus51-all.git

Change directories into luaplus51-all. Build LuaPlus by running:

    jam

When finished a bin.compilers.platform/ directory will have been created. Set the LUA_BIN environment variable to point to the directory.

On Windows, you would do so like:

    set LUA_BIN=d:/luaplus51-all/bin.vs2010.win32

In a Bash shell under Linux or Mac OS X, you would export:

    export LUA_BIN=~/luaplus51-all/bin.gcc.linux32

Change directories back to the JamPlus/src/ directory. Run the appropriate jmake/make command again, and the LuaPlus binaries will be copied to the appropriate JamPlus/bin/ directory.