Skip to content
Scott Shillcock edited this page Aug 27, 2010 · 1 revision

This page explains how to set up and build DMZ from scratch.

Prerequisites

The following software must be installed before building DMZ:

There is a "kb page":http://help.dmzdev.org/faqs/programming-guides/git about how git is used with DMZ. There are "guides":http://github.com/guides/home available from "github":http://github.com. A creative commons book called "Pro Git":http://progit.org is also available.

Mac OS X

Windows XP

When installing Cygwin, make sure to install git and ssh. Other packages that may be useful are: vim, zip, and wget.

The Microsoft Visual Studio compilers must be accessible from the Cygwin bash command line. The standard install of Visual Studio includes a bat file that will properly set up the environment called vsvars32.bat

To add the bat file to the Cygwin environment, right click on the Cygwin icon that the installer places on the desktop and select edit. The Cygwin.bat file should appear as follows for Visual Studio 2005:

@echo off
call "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
C:
chdir C:\cygwin\bin

bash --login -i

And as follows for Visual Studio 2008:

@echo off
call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
C:
chdir C:\cygwin\bin

bash --login -i

If the environment is configured correctly, invoking cl should produce the following:

Setting environment for using Microsoft Visual Studio 2005 x86 tools.

% cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Cygwin installs an executable called link.exe that conflicts with the Visual Studio linker of the same name. The Cygwin version of link.exe is not need by the DMZ build system. The best way to resolve This conflict is to rename it as follows:

% cd /bin
% mv link.exe link_cygwin.exe

Getting DMZ

The latest code is available with "git":http://git.or.cz/ and is hosted at "github.com/dmzdev":http://github.com/dmzdev.

The source code may be browsed "here":http://github.com/dmzdev/dmz.

In order to check out source code, it is best to "create":https://github.com/signup/free a free github account and "fork":http://github.com/guides/fork-a-project-and-submit-your-modifications the desired repositories. At a minimum the following repositories should be "forked":http://github.com/guides/fork-a-project-and-submit-your-modifications "dmz":http://github.com/dmzdev/dmz, "lmk":http://github.com/dmzdev/lmk, "scripts":http://github.com/dmzdev/scripts, and at least one demo application such as "cycles":http://github.com/dmzdev/cycles or "io":http://github.com/dmzdev/io.

After forking the github repositories, it will be necessary to check the source code out locally in order to build it. For this guide it will be assumed that the home directory is /Users/<username> under OS X and /home/<username> under Cygwin. In both cases, this will be referred to as the home directory.

Make Project Directory

Make a new directory to hold the project in the home directory:

cd ~
mkdir cm
cd cm
mkdir lmkproject
mkdir src

Get DMZ

Check out the DMZ repository to a suitable location:

cd ~/cm/src
git clone git@github.com:<your git hub account>/dmz.git

This will have checked the DMZ repository out into a folder called dmz.

Get LMK

Get the build system:

cd ~/cm/src
git clone git@github.com/<your git hub account>/lmk.git

DMZ uses a custom build system called "LMK":http://help.dmzdev.org/faqs/programming-guides/lmk-build-system-overview that is built on top of "Lua":http://www.lua.org/.

It is a good idea to add ~/cm/src/lmk to the shell $PATH environment variable so that lmk may be invoked with out the full path.

Get the Utility Scripts

cd ~/cm/src
git clone git@github.com/<your git hub account>/scripts.git

Get Dependencies

Prebuilt dependancies are "available":http://github.com/dmzdev/dmz/downloads for Win32 and Mac OS X. Place the zip file in the cm directory.

Setting up prebuilt dependancies for OS X:

cd ~/cm
unzip depend-macos-10.5-32-<date>.zip

The FMOD audio module requires its dynamic load library path be added to .bashrc or to .bash_profile:

export DYLD_LIBRARY_PATH=~/cm/depend/fmod/api/lib:~/cm/depend/fmod/api/plugins

By default, Mac OS uses OpenAL for audio so this step is optional.

Setting up prebuilt dependencies for Windows:

cd ~/cm
unzip depend-windows-msvc8-32-<date>.zip

See "Linux Readme":http://help.dmzdev.org/faqs/general/linux-readme for setting up dependancies for a "Ubuntu":http://ubuntu.com Linux system.

Get Assets

External assets are require to run the "Hoverover":http://github.com/dmzdev/io and "Cycles":http://github.com/dmzdev/cycles demos. Assets for each of these demos is located in the Downloads section of the project. Once the assets have been down loaded, copy them into the cm directory and unzip them.

cd ~/cm
unzip cycles-assets-<date>.zip
unzip io-assets-<date>.zip

Building DMZ

To build DMZ, execute the following command in the base project directory.

cd ~/cm/src
lmk -u -b

Some example LMK build commands:

cd ~/cm/src

lmk -u # updates ~/dmz/lmkproject/lmkfiles.lua
lmk -b # to build with default options
lmk -f test -b # to run unit tests, make sure the DYLD_LIBRARY_PATH is set
lmk -f distclean
lmk -f clean
lmk -m opt -b # to build optimized

"LMK Build System Overview":http://help.dmzdev.org/faqs/programming-guides/lmk-build-system-overview has more details about using LMK.

New Plugins and Interfaces

"Plugins And Interfaces":http://help.dmzdev.org/faqs/programming-guides/plugins-and-interfaces has more details about creating new Plugins and Interfaces.

Before submitting code, please ensure that it conforms the "Programming Practices":http://help.dmzdev.org/faqs/programming-guides/programming-practices Guide.