Compiling MAME

The Final Checks

Find your c:\mamesrc folder in My Computer. You'll see this...

mamesrc folder

If you have put mingw in a different folder other than c:\mingw then you need to set the path for it in both batch files. Right click the MakeMAME.bat file and select "Edit". This will open the file in notepad like this...

makemame.bat

Where it says set path= change the path to where the mingw folder is.

Do the same for the PatchMAME.bat file like this...

PatchMAME.bat

Double click the command prompt icon and you'll see this...

command prompt

Type makemame, press enter and the compilation process will take place. This can take from minutes to hours depending on you processor. It take between 7 and 8 minutes on my C2D E8400 @ 3.3ghz with compiler optimizations. You can abort the process at any time by pressing ctrl+c. The screen will say "Terminate Batch Job Y/N" press y to exit.

Once its done

The compiler will create all the "EXE" files that you normally get with MAME including obviously MAME itself. These will get deposited in your c:\mamesrc folder and include...

mame.exe
ledutil.exe
jedutil.exe
romcmp.exe
chdman.exe
makemeta.exe
regrep.exe
srcclean.exe
src2html.exe

Compile After

You need to copy them to your normal MAME folder and overwrite the old files. If the version is newer than your old one you may need to follow the Mame Updates page here.

You will also notice a folder called obj which contains the ready compiled parts of MAME. If you update the source then the compiler will use the ready compiled parts in this folder and only have to compile the updated ones. It's only worth deleting this folder if you get compiler errors.

Speeding Things Up!

MingW can be optimized for different processor both for compiling and for the programs created. To produce optimized build you need to edit the MakeMAME.bat file again. You need to add an option to the mingw23-make line. Here are the options...

 

These will give a bit more speed to MAME but not to how long it takes to compile. For that you need a dual or quad core processor and then you need to add -j3 (dual core) or -j5 (quad core) to the mingw32-make line. For example here is the line in my makemame.bat file...

mingw32-make -j3 ARCHOPTS="-march=pentium-m -msse3"

 

back