Building the Framework

Creating the Project Files

To enable the type of community-developed system I'm dreaming about I plan to use the Premake build script generator for the build environment configuration. Premake is a small, single file executable that provides configuration abilities similar to Unix-style configure scripts, with the added ability of generating project files for a number of different tool sets (and it runs on Windows). Installing Premake is as simple as downloading it and putting the executable somewhere on your system search path. Right now I am only using Premake to generate the project files, but later on I will be adding more advanced configuration code.

To get started, download and install Premake (version 3.4 or later). Open a command shell and switch to the root FlatFour directory. From here, Premake can show you all of the project configuration options.

$ cd FlatFour
$ premake --help

Visual Studio 2005, SharpDevelop 2

Both of these development environments use the Visual Studio 2005 project file format. To generate a solution file, run the following Premake command (this will work for Visual Studio 2005 Express too):

$ premake --target vs2005

Mono with GNU Make (Linux and MacOS X)

The following Premake command will generate makefiles that use the gmcs compiler. You must have both the base Mono packages and gmcs installed, of course.

$ premake --dotnet mono2 --target gnu

MonoDevelop

I would like to support MonoDevelop, but it has some issues I haven't been able to work around. At the time of this writing, it doesn't support C# 2.0 even though gmcs does. Also, it doesn't handle App.config files properly (they need to be copied to the output directory and renamed). If things have changed let me know and I will take another look. In the meantime, you can use the GNU make instructions above.

Cleaning Up

If you ever decide that you want to restore the source code directory to its original state, you can use the Premake "clean" command. This will remove all generated project files and compiled binaries.

$ premake --clean

Building the Framework

At this point, there should be a solution or makefile in the root FlatFour directory. You can load it and build as you normally would.

Folks using the makefiles should note that it builds the debug binaries by default. To get a set of release binaries, set the CONFIG variable at the command line (case sensitive).

$ make CONFIG=Release

Running FlatFour.Host

The framework includes a hosting application called FlatFour.Host. This will eventually be an integral part of the framework, but for now it is just a sample application showing how to use the framework components.

Windows

You can launch FlatFour.Host.exe from the command line or from within the IDE.

Linux

Launch FlatFour.Host.exe from the command line. Depending on your system, you might need to invoke mono explicitly like this:

$ cd Bin/Debug
$ mono FlatFour.Host.exe

MacOS X

The Framework needs to be packaged into an application bundle in order to run properly under MacOS X. Use the supplied "macbundle" script to create a new bundle for the FlatFour.Host executable.

$ sh macbundle.sh
$ open Bin/Debug/FlatFour.Host.app