Previous 15994 Revisions Next

r1366 Monday 3rd December, 2007 at 23:14:26 UTC by Dirk Best
Combined makefile and makefile.mes, the only difference between them now is the default target. You can use 'make TARGET=mess' to build MESS now. Changes to MAME files have been submit to mamedev.
[ROOT]makefile makefile.mes
[src/mess]mess.mak messcore.mak tiny.mak
[src/mess/osd/windows]windows.mak
[src/mess/tools/messdocs]messdocs.mak
[src/osd/windows]windows.mak
[src/osd/winui]ui.mak

makefile.mes
r1365r1366
22#
33#   makefile.mes
44#
5#   Core makefile for building MESS and derivatives
5#   Core makefile for building MAME and derivatives
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8#   Visit http://mamedev.org for licensing and usage restrictions.
9#
710###########################################################################
811
912
r1365r1366
213216
214217# fullname is prefix+name+suffix+debugsuffix
215218FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)$(DEBUGSUFFIX)
216FULLGUINAME = $(PREFIX)$(NAME)gui$(SUFFIX)$(DEBUGSUFFIX)
217219
218220# add an EXE suffix to get the final emulator name
219EMULATORCLI = $(FULLNAME)$(EXE)
220EMULATORGUI = $(FULLGUINAME)$(EXE)
221EMULATOR = $(FULLNAME)$(EXE)
221222
222# MESS on Windows builds a DLL by default
223ifeq ($(OSD),windows)
224EMULATORDLL = $(FULLNAME)lib.dll
225EMULATOR = $(EMULATORDLL) $(EMULATORCLI) $(EMULATORGUI)
226else
227EMULATOR = $(EMULATORCLI)
228endif
229223
230224
231
232225#-------------------------------------------------
233226# source and object locations
234227#-------------------------------------------------
r1365r1366
245238# compile-time definitions
246239#-------------------------------------------------
247240
248# add an additional define for MESS
249ifeq ($(TARGET),mess)
250MESS = 1
251endif
252
253241# CR/LF setup: use both on win32/os2, CR only on everything else
254242DEFS = -DCRLF=2
255243
256244ifeq ($(TARGETOS),win32)
257DEFS = -DCRLF=3 -DWIN32 -DWINNT
258WINUI = 1
245DEFS = -DCRLF=3
259246endif
260247ifeq ($(TARGETOS),os2)
261248DEFS = -DCRLF=3
r1365r1366
362349   -I$(SRC)/osd \
363350   -I$(SRC)/osd/$(OSD) \
364351
365ifdef MESS
366CFLAGS += \
367   -I$(SRC)/mame \
368   -I$(SRC)/mame/includes \
369   -I$(SRC)/$(TARGET)/osd/$(OSD)
370endif
371352
372353
373354#-------------------------------------------------
r1365r1366
474455include $(SRC)/osd/$(OSD)/$(OSD).mak
475456
476457# then the various core pieces
477include $(SRC)/mess/messcore.mak
478458include $(SRC)/$(TARGET)/$(SUBTARGET).mak
479include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
480459include $(SRC)/emu/emu.mak
481460include $(SRC)/lib/lib.mak
482461include $(SRC)/build/build.mak
r1365r1366
497476
498477tools: maketree $(TOOLS)
499478
500help: maketree $(MESSHELP)
479help: maketree $(HELP)
501480
502481maketree: $(sort $(OBJDIRS))
503482
r1365r1366
528507# executable targets and dependencies
529508#-------------------------------------------------
530509
531ifeq ($(OSD),windows)
510ifndef EXECUTABLE_DEFINED
532511
533ifdef MSVC_BUILD
534DLLLINK=lib
535else
536DLLLINK=dll
537endif
538
539$(EMULATORDLL): $(VERSIONOBJ) $(OBJ)/mess/osd/windows/messlib.o $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(MESS_WINOBJ)/mess.res
540# always recompile the version string
541   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
542   @echo Linking $@...
543   $(LD) -shared $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
544
545# gui target
546$(EMULATORGUI):   $(EMULATORDLL) $(OBJ)/mess/osd/winui/guimain.o $(GUIRESFILE)
547   @echo Linking $@...
548   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mwindows $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/winui/guimain.o $(GUIRESFILE) $(LIBS) -o $@
549
550# cli target
551$(EMULATORCLI):   $(EMULATORDLL) $(OBJ)/mess/osd/windows/climain.o
552   @echo Linking $@...
553   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mconsole $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/windows/climain.o $(LIBS) -o $@
554
555else
556
557512$(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE)
558513# always recompile the version string
559514   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
src/osd/windows/windows.mak
r1365r1366
246246
247247
248248#-------------------------------------------------
249# if building with a UI, include the ui.mak
250#-------------------------------------------------
251
252ifdef WINUI
253include $(SRC)/osd/winui/ui.mak
254endif
255
256
257
258#-------------------------------------------------
259249# rules for building the libaries
260250#-------------------------------------------------
261251
src/osd/winui/ui.mak
r1365r1366
1111
1212OBJDIRS += $(WINUIOBJ)
1313   
14ifdef MESS
1514MESS_WINUISRC = $(SRC)/mess/osd/winui
1615MESS_WINUIOBJ = $(OBJ)/mess/osd/winui
1716OBJDIRS += $(MESS_WINUIOBJ)
1817CFLAGS += -I$(WINUISRC) -I$(MESS_WINUISRC)
19endif
2018
2119
2220
r1365r1366
4947   $(WINUIOBJ)/m32opts.o \
5048   $(WINUIOBJ)/win32ui.o \
5149   $(WINUIOBJ)/helpids.o \
52
53ifdef MESS
54WINUIOBJS += \
5550   $(MESS_WINUIOBJ)/mess32ui.o \
5651   $(MESS_WINUIOBJ)/optionsms.o \
5752    $(MESS_WINUIOBJ)/layoutms.o \
r1365r1366
5954   $(MESS_WINUIOBJ)/propertiesms.o \
6055   $(MESS_WINUIOBJ)/softwarepicker.o \
6156   $(MESS_WINUIOBJ)/devview.o
62else
63WINUIOBJS += \
64    $(WINUIOBJ)/layout.o \
65   $(WINUIOBJ)/m32main.o \
66   $(WINUIOBJ)/mame32.res
67endif
6857
69ifdef MESS
70# extra dependencies
71# $(MESS_WINUIOBJ)/mess32ui.o:   $(WINUISRC)/win32ui.c $(MESS_WINUISRC)/mess32ui.c
72# $(MESS_WINUIOBJ)/optionsms.o:   $(WINUISRC)/options.c $(MESS_WINUISRC)/optionsms.c
73endif
74   
58
7559# add resource file
76ifdef MESS
7760GUIRESFILE = $(MESS_WINUIOBJ)/mess32.res
78endif
7961
8062$(LIBOSD): $(WINUIOBJS)
8163
r1365r1366
11799#####################################################################
118100# Resources
119101
120ifndef MESS
121UI_RC = @windres --use-temp-file
122102
123UI_RCDEFS = -DNDEBUG -D_WIN32_IE=0x0400
124
125UI_RCFLAGS = -O coff --include-dir $(WINUISRC)
126
127$(WINUIOBJ)/%.res: $(WINUISRC)/%.rc
128   @echo Compiling mame32 resources $<...
129   $(UI_RC) $(UI_RCDEFS) $(UI_RCFLAGS) -o $@ -i $<
130endif
131
132103#####################################################################
133104# Linker
134105
r1365r1366
141112
142113endif
143114
144ifndef MESS
145LDFLAGS += -mwindows
146endif
147115
116
148117#####################################################################
149118
150ifdef MESS
151119
152120$(MESS_WINUIOBJ)/mess32.res:   $(WINUISRC)/mame32.rc $(MESS_WINUISRC)/mess32.rc $(WINUISRC)/resource.h $(MESS_WINUISRC)/resourcems.h $(WINUIOBJ)/mamevers.rc
153121   @echo Compiling resources $<...
r1365r1366
156124$(WINUIOBJ)/mamevers.rc: $(WINOBJ)/verinfo$(EXE) $(SRC)/version.c
157125   @echo Emitting $@...
158126   @$(VERINFO) $(SRC)/version.c > $@
159
160endif
src/mess/messcore.mak
r1365r1366
1313
1414COREDEFS += -DMESS
1515
16# add some additional include libraries for the mame files
17CFLAGS += \
18   -I$(SRC)/mame \
19   -I$(SRC)/mame/includes \
20   -I$(SRC)/mess/osd/$(OSD)
1621
22
1723# Root object directories
1824MAMESRC = $(SRC)/mame
1925MAMEOBJ = $(OBJ)/mame
src/mess/tiny.mak
r1365r1366
33#   tiny.mak
44#
55#   Small driver-specific example makefile
6#   Use make SUBTARGET=tiny to build
6#   Use make TARGET=mess SUBTARGET=tiny to build
77#
88#   As an example this makefile builds MESS with the three Colecovision
99#   drivers enabled only.
r1365r1366
1414###########################################################################
1515
1616
17# include MESS core defines
18include $(SRC)/mess/messcore.mak
19include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
20
21
1722#-------------------------------------------------
1823# Specify all the CPU cores necessary for the
1924# drivers referenced in tiny.c.
r1365r1366
5358
5459
5560
61#-------------------------------------------------
62# MESS special OSD rules
63#-------------------------------------------------
64
65include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
src/mess/tools/messdocs/messdocs.mak
r1365r1366
1010# messdocs executable name
1111MESSDOCS = messdocs$(EXE)
1212
13MESSHELP = mess.chm
13# messdocs will create this file
14HELPOBJ = $(OBJ)/help
15MESSHELP = mess.chm
1416
15# messdocs directories
17# add our stuff to the global variables
1618OBJDIRS += $(MESSOBJ)/tools/messdocs
19HELP += $(MESSHELP)
1720
18HELPOBJ = $(OBJ)/help
1921
2022
2123#-------------------------------------------------
src/mess/osd/windows/windows.mak
r1365r1366
77###########################################################################
88
99
10# build the executable names
11FULLGUINAME = $(PREFIX)$(NAME)gui$(SUFFIX)$(DEBUGSUFFIX)
12EMULATORCLI = $(FULLNAME)$(EXE)
13EMULATORGUI = $(FULLGUINAME)$(EXE)
14EMULATORDLL = $(FULLNAME)lib.dll
15EMULATOR += $(EMULATORDLL) $(EMULATORGUI)
16
1017CFLAGS += -DWINUI -DEMULATORDLL=\"$(EMULATORDLL)\"
1118RCFLAGS += -DMESS
1219
r1365r1366
4047$(LIBOCORE_NOMAIN): $(OSDCOREOBJS:$(WINOBJ)/main.o=)
4148
4249
50ifdef MSVC_BUILD
51DLLLINK = lib
52else
53DLLLINK = dll
54endif
4355
56
57
4458#-------------------------------------------------
59# if building with a UI, include the ui.mak
60#-------------------------------------------------
61
62include $(SRC)/osd/winui/ui.mak
63
64
65
66#-------------------------------------------------
4567# generic rules for the resource compiler
4668#-------------------------------------------------
4769
r1365r1366
5678$(OBJ)/mess/ui/%.res: mess/ui/%.rc
5779   @echo Compiling resources $<...
5880   $(RC) $(RCDEFS) $(RCFLAGS) --include-dir mess/ui --include-dir src/ui --include-dir src -o $@ -i $<
81
82
83
84#-------------------------------------------------
85# executable targets
86#-------------------------------------------------
87
88EXECUTABLE_DEFINED = 1
89
90$(EMULATORDLL): $(VERSIONOBJ) $(OBJ)/mess/osd/windows/messlib.o $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(MESS_WINOBJ)/mess.res
91# always recompile the version string
92   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
93   @echo Linking $@...
94   $(LD) -shared $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
95
96# gui target
97$(EMULATORGUI):   $(EMULATORDLL) $(OBJ)/mess/osd/winui/guimain.o $(GUIRESFILE)
98   @echo Linking $@...
99   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mwindows $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/winui/guimain.o $(GUIRESFILE) $(LIBS) -o $@
100
101# cli target
102$(EMULATORCLI):   $(EMULATORDLL) $(OBJ)/mess/osd/windows/climain.o
103   @echo Linking $@...
104   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mconsole $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/windows/climain.o $(LIBS) -o $@
src/mess/mess.mak
r1365r1366
77###########################################################################
88
99
10# include MESS core defines
11include $(SRC)/mess/messcore.mak
12
13
1014#-------------------------------------------------
1115# specify available CPU cores; some of these are
1216# only for MAME and so aren't included
r1365r1366
11561160
11571161
11581162#-------------------------------------------------
1163# MESS special OSD rules
1164#-------------------------------------------------
1165   
1166include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
1167
1168
1169
1170#-------------------------------------------------
11591171# MESS text files
11601172#-------------------------------------------------
11611173
makefile
r1365r1366
191191AR = @ar
192192CC = @gcc
193193LD = @gcc
194HHC = @-hhc
194195MD = -mkdir$(EXE)
195196RM = @rm -f
196197
r1365r1366
402403LIBSOUND = $(OBJ)/libsound.a
403404LIBUTIL = $(OBJ)/libutil.a
404405LIBOCORE = $(OBJ)/libocore.a
406LIBOCORE_NOMAIN = $(OBJ)/libocore_nomain.a
405407LIBOSD = $(OBJ)/libosd.a
406408
407409VERSIONOBJ = $(OBJ)/version.o
r1365r1366
474476
475477tools: maketree $(TOOLS)
476478
479help: maketree $(HELP)
480
477481maketree: $(sort $(OBJDIRS))
478482
479483clean:
r1365r1366
503507# executable targets and dependencies
504508#-------------------------------------------------
505509
510ifndef EXECUTABLE_DEFINED
511
506512$(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE)
507513# always recompile the version string
508514   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
509515   @echo Linking $@...
510516   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
511517
518endif
512519
513520
521
514522#-------------------------------------------------
515523# generic rules
516524#-------------------------------------------------

Previous 15994 Revisions Next


© 1998-2018 The MESS Team