====== Compile MESS ======
Compiling MESS is the same process as building MAME, but after the ''make'' command you add ''TARGET=mess''. Read on for step-by-step instructions.
Note: the compile environment used for MESS has changed several times over the years. If you are trying to compile an old version, refer to previous versions of this document:
* [[Compiling MESS 0.161]] for 0.137-0.161
* [[Compiling MESS 0.136]] for older versions
===== Setting up the build tools on Windows =====
Download the [[http://mamedev.org/tools/|build tools]] installer and perform the installation (this may take some time).
Then run ''buildtools.bat'' (plain) or ''cmder.exe'' (fancy) to get a command-line environment.
Then run the following commands to install mingw:
For 32 bit OS:
install-mingw32
For 64 bit OS:
install-mingw64
Install SDL (optional):
install-sdl
Install QT (optional, only needed if you want to compile the QT-based debugger interface):
install-qt
===== Setting up the source =====
Starting with version 0.162, MESS is included in the MAME source tree, so download the latest MAME source release from the [[http://mamedev.org/release.html|release page]] and extract it into an appropriate directory, or clone the [[https://github.com/mamedev/mame|GitHub repository]]:
git clone https://github.com/mamedev/mame.git
Note that the latest git revision may not necessarily work or even compile!
===== Building MESS on Windows =====
You are now ready to compile MESS. To do so, change to the directory where you installed the 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'' (Note capitalization! It will not work if you capitalize MESS here)
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 and creates the mess executables…
When it's finished, you will have a new executable, ''mess.exe'' (or ''mess64.exe'' for 64-bit).
You will need to create MESS's config files before running, to do that, type ''mess -cc'' (or ''mess64 -cc''):
D:\mess>mess -cc
You have now fully compiled MESS, have fun! :)
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 [[http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en|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 [[compiling_mess#setting_up_the_source|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 =====
* [[http://mamedev.org/devwiki/index.php?title=Building_MAME_using_Microsoft_Visual_Studio_compilers|Building MAME using Microsoft Visual Studio compilers]]