compiling_mess

# Compiling MESS

Compiling MESS is essentially the same process as building MAME, but after the `make` or `mingw32-make` command you add `TARGET=mess`. Read on for step-by-step instructions.

Note: the compiler used for MESS and MAME on Windows has changed starting with version 0.137. You will need to download a new set of build tools if you were previously set up for compiling 0.136. See Compiling MESS 0.136 for the older instructions.

## Setting up the source

MESS is developed as a patch for the MAME source, so the MESS source distribution does not include important files like the makefile, which come from MAME.

To obtain the complete source from SVN, follow the instructions here.

Otherwise, download the MESS source and the MAME source with the same version number. Extract the MAME source into a directory somewhere, then extract the MESS source overtop of it, overwriting files if prompted.

## Setting up the build tools on Windows

Download the build tools (or from MAMEDev.org) and follow the instructions to install them. To verify your install, open a command line window and try the following:

    C:\>gcc --version
    gcc (GCC) 4.4.3 20091223 (prerelease) r155431
    Copyright (C) 2009 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The output should be the same or similar. If there is an error message like this:

    C:\>gcc --version
    'gcc' is not recognized as an internal or external command,
    operable program or batch file.

Then your path environment variable is not setup correctly. To fix this temporarily, use the following command:

    C:\>path C:\MinGW\mingw64-w32\bin;%path%

(32-bit)

    C:\>path C:\MinGW\mingw64-w64\bin;%path%

(64-bit)

If you installed the tools into a different directory, change the location appropriately.

## Building MESS on Windows

You are now ready to compile MESS. To do so, change to the directory where you installed the MESS (and MAME) sources using the `cd` command and drive letters. For example:

    C:\>D:

    D:\>cd mess

    D:\mess>

To start the build process, type `make TARGET=mess`

    D:\mess>make TARGET=mess
    mkdir.exe -p obj/windows/mess
    mkdir.exe -p obj/windows/mess/build
    mkdir.exe -p obj/windows/mess/emu/audio
    mkdir.exe -p obj/windows/mess/emu/cpu
    mkdir.exe -p obj/windows/mess/emu/cpu/apexc
    ...

This builds the code mess executables…

When it's finished, you will have a new executable, `mess.exe`.

You will need to create MESS's config files before running, to do that, type `mess -cc`:

    D:\mess>mess -cc

You have now fully compiled MESS, have fun! :)

To compile the MESS with its Windows UI, add `OSD=winui`:

    D:\mess>make TARGET=mess OSD=winui

To compile the MESS tools (chdman, imgtool, etc.), use make all:

    D:\mess>make all

If you are building on a windows platform and you want to build the mess.chm help file (you will need to have installed the HTML Help Workshop), type:

    D:\mess>make mess.chm TARGET=mess

To compile a symbols-enabled version for backtracing add `SYMBOLS=1`:

    D:\mess>make TARGET=mess SYMBOLS=1

## Building MESS on *nix

Once you've set up the source, building MESS on Linux or other UNIX-based systems is simple (assuming you have the appropriate packages installed for make, gcc, etc.):

    $ make TARGET=mess

To compile the MESS tools (chdman, imgtool, etc.), add `tools`:

    $ make TARGET=mess tools

MESS does not provide a 'make install' target at this time; binaries are placed in the top-level MESS directory.

## See also

- Building MAME using Microsoft Visual Studio compilers