'''This page is a work in progress, please don't report bugs until it's done''' == Step 1: Install XCode == First you'll need to install XCode. The tools installed with it include the compilers you'll need to compile the game and the libraries it depends on. You can obtain XCode from http://developer.apple.com/technologies/xcode.html . You'll need a Mac Dev account, but registration and download is free. Once downloaded, double click the file and follow the installation instructions. == Step 2: Obtaining the 0 A.D. source == If you want to grab the release files, you can do that. But in this guide, we'll compile SVN, which has the newest features. {{{ svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad }}} Note: Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like at revision rXXXX. Otherwise run {{{ svn up 0ad }}} There is also a Git mirror, which may be slightly less up-to-date but usually offers faster downloads. To use the Git mirror, use this command instead: {{{ git clone https://github.com/0ad/0ad.git }}} == Step 3: Building the Libraries == Now you have two options: 1. Build the game as a loose binary * Run [source:/ps/trunk/libraries/osx/build-osx-libs.sh build-osx-libs.sh], the OS X libraries build script, this will download and build the game's dependencies. {{{ #!sh cd libraries/osx ./build-osx-libs.sh -j3 }}} * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. * To build on the command line with LLVM/gcc, follow the [#Build build] instructions for Linux beginning with `./update-workspaces.sh`. * Or if you have Xcode 4 installed, you can open `build/workspaces/xcode4/pyrogenesis.xcworkspace` (see discussion on this [http://www.wildfiregames.com/forum/index.php?showtopic=15511&st=160#entry261743 here]). * Or if you're on Snow Leopard and have Xcode 3 installed, you can open `build/workspaces/xcode3/pyrogenesis.xcodeproj` * Newer versions of Xcode no longer include the command line tools by default, you need to install them as described above. Additionally, the command line tools package no longer includes GCC but it does include LLVM-GCC which is compatible. If you get errors during the build like "C compiler cannot create executables" then you probably have the newer command line tools with LLVM. The following command should fix it: {{{ #!sh export CC=gcc CXX=g++ }}} 1. Build the game as a distributable bundle * You will need Xcode installed (for its SDKs) * Open [source:/ps/trunk/build/workspaces/build-osx-bundle.sh build/workspaces/build-osx-bundle.sh] and read the comments. You might need to change a few settings depending on your version of OS X, Xcode, etc. * Run `build-osx-bundle.sh`: {{{ #!sh cd build/workspaces ./build-osx-bundle.sh -j3 }}} * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. * When it's finished, there should be a complete '''0ad app''' bundle in `build/workspaces`. == Step 5: Compiling 0 A.D. == Finally, to compile, run the following commands in a console (adjust the path on the first line to go to the actual directory source root): {{{ cd /path/to/source cd build/workspaces ./update-workspaces.sh --disable-atlas cd gcc make }}} == Step 6: Running 0 A.D. == To run the game, run the following commands in a console: {{{ cd /path/to/source cd binaries/system ./pyrogenesis }}}