| 1 |
##################################################################### |
##################################################################### |
| 2 |
|
|
| 3 |
MAME_VERSION = -DMAME_VERSION=59 |
MAME_VERSION = -DMAME_VERSION=60 |
| 4 |
|
|
| 5 |
# set this to mame, mess or the destination you want to build |
# set this to mame, mess or the destination you want to build |
| 6 |
TARGET = mame |
# TARGET = mame |
| 7 |
|
# TARGET = mess |
| 8 |
|
# TARGET = neomame |
| 9 |
|
# TARGET = cpmame |
| 10 |
|
# TARGET = mmsnd |
| 11 |
|
# example for a tiny compile |
| 12 |
|
# TARGET = tiny |
| 13 |
ifeq ($(TARGET),) |
ifeq ($(TARGET),) |
| 14 |
TARGET = mame |
TARGET = mame |
| 15 |
endif |
endif |
| 16 |
|
|
| 17 |
# select compiler |
# select compiler |
| 18 |
USE_GCC = 1 |
# USE_GCC = 1 |
| 19 |
# USE_VC = 1 |
# USE_VC = 1 |
| 20 |
|
|
| 21 |
# build a version for debugging games |
# uncomment next line to include the debugger |
| 22 |
# DEBUG = 1 |
# DEBUG = 1 |
| 23 |
|
|
| 24 |
# uncomment next line to include the symbols for symify |
# uncomment next line to include the symbols for symify |
| 25 |
# SYMBOLS = 1 |
# SYMBOLS = 1 |
| 26 |
|
|
| 27 |
# uncomment next line to generate a link map for exception handling in win32 |
# uncomment next line to generate a link map for exception handling in windows |
| 28 |
# MAP = 1 |
# MAP = 1 |
| 29 |
|
|
| 30 |
# uncomment next line to use Assembler 68000 engine |
# uncomment next line to use Assembler 68000 engine |
| 33 |
# uncomment next line to use Assembler 68020 engine |
# uncomment next line to use Assembler 68020 engine |
| 34 |
# X86_ASM_68020 = 1 |
# X86_ASM_68020 = 1 |
| 35 |
|
|
| 36 |
|
# uncomment next line to use cygwin compiler |
| 37 |
|
# COMPILESYSTEM_CYGWIN = 1 |
| 38 |
|
|
| 39 |
# uncomment next line to support 32bpp |
# uncomment next line to support 32bpp |
| 40 |
SUPPORT_32BPP = -DSUPPORT_32BPP |
SUPPORT_32BPP = -DSUPPORT_32BPP |
| 41 |
|
|
| 46 |
MAME32JP = -DMAME32JP |
MAME32JP = -DMAME32JP |
| 47 |
|
|
| 48 |
# uncomment next line to support disable blurring filter |
# uncomment next line to support disable blurring filter |
| 49 |
NFILTER = -DNFILTER |
# NFILTER = -DNFILTER |
| 50 |
|
|
| 51 |
# uncomment next line to support game selection by a joystick |
# uncomment next line to support game selection by a joystick |
| 52 |
JOYGUI = -DJOYGUI |
JOYGUI = -DJOYGUI |
| 53 |
|
|
| 54 |
# uncomment next line to support stretch to fullscreen |
# uncomment next line to support stretch to fullscreen |
| 55 |
FSSTRETCH = -DFSSTRETCH |
# FSSTRETCH = -DFSSTRETCH |
| 56 |
|
|
| 57 |
# language |
# language |
| 58 |
JAPANESE = 1 |
# JAPANESE = 1 |
| 59 |
# ENGLISH = 1 |
# ENGLISH = 1 |
| 60 |
|
|
| 61 |
# build console version |
# build console version |
| 62 |
# BUILD_CONSOLE = -DBUILD_CONSOLE |
ifdef CONSOLE_MODE |
| 63 |
|
BUILD_CONSOLE = -DBUILD_CONSOLE |
| 64 |
|
endif |
| 65 |
|
|
| 66 |
# use fast (register) calling convention (for VC). |
# use fast (register) calling convention (for VC). |
| 67 |
# USE_FASTCALL = -DFASTCALL |
# USE_FASTCALL = -DFASTCALL |
| 73 |
# PLEASE DO NOT CHANGE THE FOLLOWING SETTINGS! |
# PLEASE DO NOT CHANGE THE FOLLOWING SETTINGS! |
| 74 |
|
|
| 75 |
# if compiler is not selected, GCC is used as the default. |
# if compiler is not selected, GCC is used as the default. |
| 76 |
|
ifdef IP4 |
| 77 |
|
INTEL = 1 |
| 78 |
|
USE_VC = 1 |
| 79 |
|
USE_GCC = |
| 80 |
|
endif |
| 81 |
|
|
| 82 |
|
ifndef JAPANESE |
| 83 |
|
ifndef ENGLISH |
| 84 |
|
JAPANESE=1 |
| 85 |
|
endif |
| 86 |
|
endif |
| 87 |
|
|
| 88 |
ifndef USE_VC |
ifndef USE_VC |
| 89 |
ifndef USE_GCC |
ifndef USE_GCC |
| 90 |
USE_GCC = 1 |
USE_GCC = 1 |
| 106 |
endif |
endif |
| 107 |
|
|
| 108 |
# compiler, linker and assembler |
# compiler, linker and assembler |
|
ifdef IP4 |
|
|
INTEL = 1 |
|
|
endif |
|
| 109 |
|
|
| 110 |
ifdef USE_GCC |
ifdef USE_GCC |
| 111 |
AR = @ar |
AR = @ar |
| 134 |
|
|
| 135 |
|
|
| 136 |
# utilities |
# utilities |
| 137 |
RM = del |
RM = @rm -f |
| 138 |
RMDIR = rd /S /Q |
RMDIR = rd /S /Q |
| 139 |
MD = -md |
MD = -mkdir.exe -p |
| 140 |
|
|
| 141 |
|
|
| 142 |
ifdef USE_GCC |
ifdef USE_GCC |
| 162 |
ifdef JAPANESE |
ifdef JAPANESE |
| 163 |
LANGUAGE = -DJAPANESE |
LANGUAGE = -DJAPANESE |
| 164 |
ENGLISH = |
ENGLISH = |
|
SUFFIX = jp |
|
| 165 |
else |
else |
| 166 |
LANGUAGE = -DENGLISH |
LANGUAGE = -DENGLISH |
| 167 |
JAPANESE = |
JAPANESE = |
|
SUFFIX = e |
|
| 168 |
endif |
endif |
| 169 |
|
SUFFIX = jp |
| 170 |
|
|
| 171 |
ifdef SYMBOLS |
ifdef SYMBOLS |
| 172 |
CPUTYPE = debug |
CPUTYPE = debug |
| 198 |
COMPILETYPE = -DCOMPILETYPE=12 |
COMPILETYPE = -DCOMPILETYPE=12 |
| 199 |
else |
else |
| 200 |
ifdef IP4 |
ifdef IP4 |
| 201 |
ARCH = -G7 -QaxW |
ARCH = -G7 -QxW |
| 202 |
CPUTYPE = pentium4 |
CPUTYPE = pentium4 |
| 203 |
COMPILETYPE = -DCOMPILETYPE=3 |
COMPILETYPE = -DCOMPILETYPE=3 |
| 204 |
else |
else |
| 219 |
# some structures and thus they can't be linked against each other. |
# some structures and thus they can't be linked against each other. |
| 220 |
# cleantiny isn't needed anymore, because the tiny build has its |
# cleantiny isn't needed anymore, because the tiny build has its |
| 221 |
# own object directory too. |
# own object directory too. |
| 222 |
OBJ = obj/$(CPUTYPE) |
DIR_PREFIX1 = windows |
| 223 |
|
DIR_PREFIX2 = japanese |
| 224 |
|
ifdef CONSOLE_MODE |
| 225 |
|
DIR_PREFIX1=console |
| 226 |
|
endif |
| 227 |
|
ifdef ENGLISH |
| 228 |
|
DIR_PREFIX2 = english |
| 229 |
|
endif |
| 230 |
|
|
| 231 |
EMULATOR = exe/$(CPUTYPE)/$(NAME)$(EXE) |
DIR_SUFFIX = $(DIR_PREFIX1)/$(DIR_PREFIX2)/$(CPUTYPE) |
| 232 |
|
OBJ = obj/$(DIR_SUFFIX) |
| 233 |
|
EXEDIR = exe/$(DIR_SUFFIX) |
| 234 |
|
EMULATOR = $(EXEDIR)/$(NAME)$(EXE) |
| 235 |
|
|
| 236 |
##################################################################### |
##################################################################### |
| 237 |
# check enviroment |
# check enviroment |
| 270 |
-DHAS_CPUS \ |
-DHAS_CPUS \ |
| 271 |
-DHAS_SOUND \ |
-DHAS_SOUND \ |
| 272 |
-DLSB_FIRST=1 \ |
-DLSB_FIRST=1 \ |
|
-DZLIB_DLL \ |
|
| 273 |
$(MAME_VERSION) \ |
$(MAME_VERSION) \ |
| 274 |
$(USE_FASTCALL) \ |
$(USE_FASTCALL) \ |
| 275 |
-DMAME_FIX \ |
-DMAME_FIX \ |
| 476 |
$(OBJ)/Win32/Mame32UI \ |
$(OBJ)/Win32/Mame32UI \ |
| 477 |
$(OBJ)/Win32/hlp |
$(OBJ)/Win32/hlp |
| 478 |
|
|
| 479 |
|
ifeq ($(TARGET),mmsnd) |
| 480 |
|
OBJDIRS += $(OBJ)/mmsnd $(OBJ)/mmsnd/machine $(OBJ)/mmsnd/drivers $(OBJ)/mmsnd/sndhrdw |
| 481 |
|
endif |
| 482 |
|
|
| 483 |
##################################################################### |
##################################################################### |
| 484 |
|
|
| 485 |
all: maketree $(EMULATOR) extra |
all: maketree $(EMULATOR) extra |
| 503 |
DBGOBJS = |
DBGOBJS = |
| 504 |
endif |
endif |
| 505 |
|
|
| 506 |
#extra: $(TOOLS) $(HELPFILES) |
ifdef COMPILESYSTEM_CYGWIN |
| 507 |
extra: $(HELPFILES) |
CFLAGS += -mno-cygwin |
| 508 |
|
LDFLAGS += -mno-cygwin |
| 509 |
|
endif |
| 510 |
|
|
| 511 |
|
extra: $(TOOLS) $(HELPFILES) |
| 512 |
|
|
| 513 |
# combine the various definitions to one |
# combine the various definitions to one |
| 514 |
CDEFS = $(DEFS) $(COREDEFS) $(CPUDEFS) $(SOUNDDEFS) $(ASMDEFS) $(DBGDEFS) |
CDEFS = $(DEFS) $(COREDEFS) $(CPUDEFS) $(SOUNDDEFS) $(ASMDEFS) $(DBGDEFS) |
| 515 |
|
|
| 516 |
|
# primary target |
| 517 |
$(EMULATOR): $(OBJS) $(COREOBJS) $(OSOBJS) $(DRVLIBS) $(RES) |
$(EMULATOR): $(OBJS) $(COREOBJS) $(OSOBJS) $(DRVLIBS) $(RES) |
| 518 |
# always recompile the version string |
# always recompile the version string |
| 519 |
ifdef USE_GCC |
ifdef USE_GCC |
| 522 |
$(CC) $(CDEFS) $(CFLAGS) -Fo$(OBJ)/version.o -c src/version.c |
$(CC) $(CDEFS) $(CFLAGS) -Fo$(OBJ)/version.o -c src/version.c |
| 523 |
endif |
endif |
| 524 |
@echo Linking $@... |
@echo Linking $@... |
| 525 |
|
$(MD) $(EXEDIR) |
| 526 |
ifdef USE_GCC |
ifdef USE_GCC |
| 527 |
$(LD) $(LDFLAGS) $(PROGRAM_TYPE) $(OBJS) $(COREOBJS) $(OSOBJS) $(LIBS) $(DRVLIBS) $(RES) -o $@ |
$(LD) $(LDFLAGS) $(PROGRAM_TYPE) $(OBJS) $(COREOBJS) $(OSOBJS) $(LIBS) $(DRVLIBS) $(RES) -o $@ |
| 528 |
else |
else |
| 532 |
# upx $(EMULATOR) |
# upx $(EMULATOR) |
| 533 |
endif |
endif |
| 534 |
|
|
| 535 |
romcmp$(EXE): $(OBJ)/romcmp.o $(OBJ)/unzip.o |
romcmp$(EXE): $(OBJ)/romcmp.o $(OBJ)/unzip.o $(OBJ)/zlib.a |
| 536 |
@echo Linking $@... |
@echo Linking $@... |
| 537 |
ifdef USE_GCC |
ifdef USE_GCC |
| 538 |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $^ $(LIBS) -o $@ |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $^ $(OBJ)/zlib.a $(LIBS) -o $@ |
| 539 |
else |
else |
| 540 |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $(LIBS) $(OBJ)/Win32/dirent.o -out:$@ $^ |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $(OBJ)/zlib.a $(LIBS)$(OBJ)/Win32/dirent.o -out:$@ $^ |
| 541 |
endif |
endif |
| 542 |
|
|
| 543 |
hdcomp$(EXE): $(OBJ)/romcmp.o $(OBJ)/unzip.o |
hdcomp$(EXE): $(OBJ)/romcmp.o $(OBJ)/unzip.o $(OBJ)/zlib.a |
| 544 |
@echo Linking $@... |
@echo Linking $@... |
| 545 |
ifdef USE_GCC |
ifdef USE_GCC |
| 546 |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $^ $(LIBS) -o $@ |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $^ $(OBJ)/zlib.a $(LIBS) -o $@ |
| 547 |
else |
else |
| 548 |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $(LIBS) $(OBJ)/Win32/dirent.o -out:$@ $^ |
$(LD) $(LDFLAGS) $(CONSOLE_PROGRAM) $(OBJ)/zlib.a $(LIBS) $(OBJ)/Win32/dirent.o -out:$@ $^ |
| 549 |
endif |
endif |
| 550 |
|
|
| 551 |
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
| 680 |
|
|
| 681 |
$(OBJ)/%.a: |
$(OBJ)/%.a: |
| 682 |
@echo Archiving $@... |
@echo Archiving $@... |
| 683 |
@if exist $@ $(RM) $(subst /,\,$@) |
$(RM) $@ |
| 684 |
ifdef USE_GCC |
ifdef USE_GCC |
| 685 |
$(AR) cr $@ $^ |
$(AR) cr $@ $^ |
| 686 |
else |
else |
| 695 |
@echo make makedir is no longer necessary, just type make |
@echo make makedir is no longer necessary, just type make |
| 696 |
|
|
| 697 |
$(sort $(OBJDIRS)): |
$(sort $(OBJDIRS)): |
| 698 |
$(MD) $(subst /,\,$@) |
$(MD) $@ |
| 699 |
|
|
| 700 |
maketree2: |
maketree2: |
| 701 |
@echo Making object tree... |
@echo Making object tree... |
| 704 |
|
|
| 705 |
clean: |
clean: |
| 706 |
@echo Deleting object tree $(OBJ)... |
@echo Deleting object tree $(OBJ)... |
|
# @if exist $(OBJ) $(RMDIR) $(subst /,\,$(OBJ)) |
|
|
# @echo Deleting $(EMULATOR)... |
|
|
# @if exist $(EMULATOR) $(RM) $(EMULATOR) |
|
| 707 |
$(RM) -r $(OBJ) |
$(RM) -r $(OBJ) |
| 708 |
@echo Deleting $(EMULATOR)... |
@echo Deleting $(EMULATOR)... |
| 709 |
$(RM) $(EMULATOR) |
$(RM) $(EMULATOR) |
| 713 |
$(RM) -r $(OBJ)/cpuintrf.o |
$(RM) -r $(OBJ)/cpuintrf.o |
| 714 |
$(RM) -r $(OBJ)/drivers/cps2.o |
$(RM) -r $(OBJ)/drivers/cps2.o |
| 715 |
$(RM) -r $(OBJ)/cpu/m68000 |
$(RM) -r $(OBJ)/cpu/m68000 |
|
|
|
|
update: |
|
|
@echo Deleting old object files... |
|
|
# @if exist $(OBJ)\vidhrdw\neogeo.o $(RM) $(OBJ)\vidhrdw\neogeo.o |
|