Chapter 7. Compiling the Code – Step by Step

Table of Contents

7.1. From Source to Package for Release (UNIX-like Systems Only)
7.2. Compiling the ZQuake Engine on Windows

Remember that the build scripts, used to generate packages for releases, will only work on UNIX-like systems (currently). Other notes on the use of Windows can be found below.

7.1. From Source to Package for Release (UNIX-like Systems Only)

  1. To compile the ZQuake engine, go into the trunk/zq-repo/zquake/ directory relative to the place where you checked-out from Subversion.

  2. You can then compile ZQuake by issuing make on a UNIX-like system, or using Visual Studio on Windows.

    Note

    Currently on UNIX-like systems, X is required. We are working on removing the need for graphical output and hopefully in the future this will not be the case. Using make help should give you the information you need to choose a compilation target.

  3. The standard build scripts for AudioQuake assume that ZQuake engine binaries for various platforms and architectures (e.g. Linux/PowerPC, Windows (x86)) are placed in a certain directory for inclusion in release packages. This directory is, by default, ../../redist/. If you checked-out the trunk/ from Subversion, put a redist/ directory in the same place as it n your filesystem. If you place engine binaries there, they'll be picked up. Conversely, if you don't they won't be and your release packages may be out-of-date!

  4. Go into the trunk/audioquake/ directory (from the location you checked-out from) and issue compile-mod-tree to compile the latest gamecode (zqcc is automatically built for you during this process, from the code in the trunk/zq-repo/zqcc/ directory) and have a release of AudioQuake installed into your home directory.

    As part of the build process, the standard set of maps (compiled into BSP form), demos and skins are downloaded from http://docs.agrip.org.uk/devfiles/. This means that you don't need to worry about compiling/finding them when you build a release.

    If you're happy with the results, you can make packages for release by issuing make-release. By default, packages are generated in ../../releases/. This means that if you check out the trunk/, you can make a releases/ directory next to it, along with the redist/ one from earlier.

    Note

    Windows releases need to be further processed into setup.exe–style files for distribution. This must be done on Windows. A ZIP file with an appropriate setup.iss (Inno Setup) file for this release will be generated; you can then put that on a Windows box to create the installer.

7.2. Compiling the ZQuake Engine on Windows

To create packages for release, you need to use a UNIX-like system currently (it will create ZIP files that are turned into self-installers for Linux and can be turned, with the help of Inno Setup on Windows, into a Windows setup program). The previous section contains instructions on this.

It is possible to build the ZQuake engine alone on Windows without using a UNIX-like system, however. To compile with Visual Studio 2003, take the following steps.

  1. You'll need the gas2masm and ml utilities to assemble the .asm files used by the engine. You can download an archive containing these from the AGRIP documentation site. Extract this archive into your /trunk/zq-repo/zquake/source/ directory.

  2. To ensure you're using the right settings for compilation, copy the .sln and .vcproj files from /trunk/zq-repo/zquake/vidnull/ to /trunk/zq-repo/zquake/source/.

  3. To compile the server and OpenGL engine, open the .sln file in VS2003 and choose the “GLRelease” configuration from the configuration manager. Then compile zqds and zquake projects.

  4. To apply the vidnull patch, needed for users of screen readers that cannot cope with OpenGL applications, copy the .c files from /trunk/zq-repo/zquake/vidnull/ to /trunk/zq-repo/zquake/source/.

  5. To compile the vidnull patch, go back into VS2003 by opening the .sln file as before, then choose the “VNRelease” configuration and compile the zquake project.