Previous 15994 Revisions Next

r1392 Saturday 8th December, 2007 at 15:30:10 UTC by R. Belmont
[SDLMESS] Sync makefile.sdl to makefile.mes and SDLMAME 0.121u3 & fix OS X problem with window.c
[ROOT]makefile.sdl
[src/osd/sdl]window.c

src/osd/sdl/window.c
r1391r1392
1818#if defined(SDLMAME_UNIX) && !defined(SDLMAME_DARWIN)
1919#include <sys/time.h>
2020#endif
21#if defined(SDLMAME_MACOSX)
22#include <sys/time.h>
23#endif
2124
2225#include "osd_opengl.h"
2326
makefile.sdl
r1391r1392
22#
33#   makefile.sdl
44#
5#   Core makefile for building MESS and derivatives
5#   Core makefile for building SDLMAME 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#
10#   SDLMAME/MESS by Olivier Galibert and R. Belmont
11#
712###########################################################################
813
914
r1391r1392
5964
6065
6166#-------------------------------------------------
67# configure name of final executable
68#-------------------------------------------------
69
70# uncomment and specify prefix to be added to the name
71# PREFIX =
72
73# uncomment and specify suffix to be added to the name
74# SUFFIX =
75
76
77
78#-------------------------------------------------
79# specify architecture-specific optimizations
80#-------------------------------------------------
81
82# uncomment and specify architecture-specific optimizations here
83# some examples:
84#   optimize for I686:   ARCHOPTS = -march=pentiumpro
85#   optimize for Core 2: ARCHOPTS = -march=pentium-m -msse3
86#   optimize for G4:     ARCHOPTS = -mcpu=G4
87# note that we leave this commented by default so that you can
88# configure this in your environment and never have to think about it
89# ARCHOPTS =
90
91
92
93#-------------------------------------------------
6294# specify program options; see each option below
6395# for details
6496#-------------------------------------------------
r1391r1392
79111# X86_VOODOO_DRC = 1
80112
81113
82WINUI = 1
83MESS = 1
84114
85
86115#-------------------------------------------------
87116# specify build options; see each option below
88117# for details
89118#-------------------------------------------------
90119
91# uncomment one of the next lines to build a target-optimized build
92# ATHLON = 1
93# I686 = 1
94# P4 = 1
95# PM = 1
96# AMD64 = 1
97# G3 = 1
98# G4 = 1
99# G5 = 1
100# CELL = 1
101
102120# uncomment next line if you are building for a 64-bit target
103121# PTR64 = 1
104122
123# uncomment next line if you are building for a big-endian target
124# BIGENDIAN = 1
125
105126# uncomment next line to build expat as part of MAME build
106127BUILD_EXPAT = 1
107128
r1391r1392
117138# uncomment next line to generate a link map for exception handling in windows
118139# MAP = 1
119140
120# uncomment next line to generate a unicode build
121# UNICODE = 1
122
123141# specify optimization level or leave commented to use the default
124142# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
125143# OPTIMIZE = 3
r1391r1392
182200
183201
184202#-------------------------------------------------
185# based on the architecture, determine suffixes
186# and endianness
187#-------------------------------------------------
188
189# by default, don't compile for a specific target CPU
190# and assume little-endian (x86)
191ARCH =
192ENDIAN = little
193
194# architecture-specific builds get extra options
195ifdef ATHLON
196SUFFIX = at
197ARCH = -march=athlon
198endif
199
200ifdef I686
201SUFFIX = pp
202ARCH = -march=pentiumpro
203endif
204
205ifdef P4
206SUFFIX = p4
207ARCH = -march=pentium4
208endif
209
210ifdef AMD64
211SUFFIX = 64
212ARCH = -march=athlon64
213endif
214
215ifdef PM
216SUFFIX = pm
217ARCH = -march=pentium3 -msse2
218endif
219
220ifdef G3
221SUFFIX = g3
222ARCH = -mtune=G3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk
223ENDIAN = big
224endif
225
226ifdef G4
227SUFFIX = g4
228ARCH = -mcpu=G4
229ENDIAN = big
230endif
231
232ifdef G5
233SUFFIX = g5
234ARCH = -mcpu=G5
235ENDIAN = big
236endif
237
238ifdef CELL
239SUFFIX = cbe
240ARCH =
241ENDIAN = big
242endif
243
244
245#-------------------------------------------------
246203# form the name of the executable
247204#-------------------------------------------------
248205
249ifdef MSVC_BUILD
250SUFFIX:=$(SUFFIX)vc
251endif
252
253# unicode builds just get the additional 'u' suffix
254ifdef UNICODE
255SUFFIX:=$(SUFFIX)u
256endif
257
258206# debug builds just get the 'd' suffix and nothing more
259207ifdef DEBUG
260SUFFIX:=$(SUFFIX)d
208DEBUGSUFFIX = d
261209endif
262210
263211# the name is just 'target' if no subtarget; otherwise it is
r1391r1392
268216NAME = $(TARGET)$(SUBTARGET)
269217endif
270218
271# fullname is prefix+name+suffix
272FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)
273FULLGUINAME = $(PREFIX)$(NAME)gui$(SUFFIX)
219# fullname is prefix+name+suffix+debugsuffix
220FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)$(DEBUGSUFFIX)
274221
275222# add an EXE suffix to get the final emulator name
276EMULATORCLI = $(FULLNAME)$(EXE)
277EMULATORGUI = $(FULLGUINAME)$(EXE)
223EMULATOR = $(FULLNAME)$(EXE)
278224
279225
280226
r1391r1392
308254DEFS += -DINLINE="static __inline__"
309255
310256# define LSB_FIRST if we are a little-endian target
311ifeq ($(ENDIAN),little)
257ifndef BIGENDIAN
312258DEFS += -DLSB_FIRST
313259endif
314260
r1391r1392
343289# we compile to C89 standard with GNU extensions
344290CFLAGS = -std=gnu89
345291
292# this speeds it up a bit by piping between the preprocessor/compiler/assembler
293CFLAGS += -pipe
294
346295# add -g if we need symbols
347296ifdef SYMBOLS
348297CFLAGS += -g
r1391r1392
358307   -Wundef \
359308   -Wformat-security \
360309   -Wwrite-strings \
361   -Wno-unused-function \
362310
311# add profiling information for the compiler
312ifdef PROFILE
313CFLAGS += -pg
314endif
315
363316# this warning is not supported on the os2 compilers
364317ifneq ($(TARGETOS),os2)
365318CFLAGS += -Wdeclaration-after-statement
r1391r1392
370323
371324# if we are optimizing, include optimization options
372325# and make all errors into warnings
373# but not on 64-bit or debug builds
374326ifneq ($(OPTIMIZE),0)
375CFLAGS += $(ARCH) -fno-strict-aliasing
327#CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing
328CFLAGS += $(ARCHOPTS) -fno-strict-aliasing
329endif
376330
377# only -Werror if not PTR64 and not DEBUG
378ifndef PTR64
379ifndef DEBUG
380#CFLAGS += -Werror
381endif   # !DEBUG
382endif   # !PTR64
383endif   # neq OPTIMIZE
384
385ifeq ($(OSD),windows)
386
387DEFS += -DWIN32 -DWINNT
388EMULATORDLL = $(FULLNAME)lib.dll
389EMULATORALL = $(EMULATORDLL) $(EMULATORCLI) $(EMULATORGUI)
390MESSDOCS = messdocs$(EXE)
391
392else
393
394EMULATORALL = $(EMULATORCLI)
395
331# if symbols are on, make sure we have frame pointers
332ifdef SYMBOLS
333CFLAGS += -fno-omit-frame-pointer
396334endif
397335
398# extra options needed *only* for the osd files
399CFLAGSOSDEPEND = $(CFLAGS)
400336
337
401338#-------------------------------------------------
402339# include paths
403340#-------------------------------------------------
r1391r1392
414351   -I$(SRC)/osd \
415352   -I$(SRC)/osd/$(OSD) \
416353
417ifdef MESS
418CFLAGS += \
419   -I$(SRC)/mame \
420   -I$(SRC)/mame/includes \
421   -I$(SRC)/$(TARGET)/osd/$(OSD)
422endif
423354
424355
425356#-------------------------------------------------
r1391r1392
428359
429360# LDFLAGS are used generally; LDFLAGSEMULATOR are additional
430361# flags only used when linking the core emulator
431LDFLAGS =
362ifneq ($(TARGETOS),macosx)
363LDFLAGS = -Wl,--warn-common
364else
365LDFLAGS=
366endif
432367LDFLAGSEMULATOR =
433368
434# strip symbols and other metadata in non-symbols builds
369# add profiling information for the linker
370ifdef PROFILE
371LDFLAGS += -pg
372endif
373
374# strip symbols and other metadata in non-symbols and non profiling builds
435375ifndef SYMBOLS
376ifndef PROFILE
377ifneq ($(TARGETOS),macosx)
436378LDFLAGS += -s
437379endif
380endif
381endif
438382
439383# output a map file (emulator only)
440384ifdef MAP
r1391r1392
507451# include files which define additional targets
508452#-------------------------------------------------
509453
510all: maketree emulator tools
454all: maketree buildtools emulator tools
511455
512456
513457
r1391r1392
519463include $(SRC)/osd/$(OSD)/$(OSD).mak
520464
521465# then the various core pieces
522include $(SRC)/mess/messcore.mak
523466include $(SRC)/$(TARGET)/$(SUBTARGET).mak
524include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
525467include $(SRC)/emu/emu.mak
526468include $(SRC)/lib/lib.mak
527469include $(SRC)/build/build.mak
r1391r1392
536478# primary targets
537479#-------------------------------------------------
538480
539emulator: maketree $(BUILD) $(EMULATORALL)
481emulator: maketree $(BUILD) $(EMULATOR)
540482
483buildtools: maketree $(BUILD)
484
541485tools: maketree $(TOOLS)
542486
487help: maketree $(HELP)
488
543489maketree: $(sort $(OBJDIRS))
544490
545491clean:
546492   @echo Deleting object tree $(OBJ)...
547493   $(RM) -r $(OBJ)
548   @echo Deleting $(EMULATORALL)...
549   $(RM) $(EMULATORALL)
494   @echo Deleting $(EMULATOR)...
495   $(RM) $(EMULATOR)
550496   @echo Deleting $(TOOLS)...
551497   $(RM) $(TOOLS)
552498ifdef MAP
r1391r1392
569515# executable targets and dependencies
570516#-------------------------------------------------
571517
518ifndef EXECUTABLE_DEFINED
572519
573ifeq ($(OSD),windows)
574
575ifdef MSVC_BUILD
576DLLLINK=lib
577else
578DLLLINK=dll
579endif
580
581$(EMULATORDLL): $(VERSIONOBJ) $(OBJ)/mess/osd/windows/messlib.o $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(LIBWINUI) $(MESS_WINOBJ)/mess.res
520$(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE)
582521# always recompile the version string
583522   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
584523   @echo Linking $@...
585   $(LD) -shared $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
524   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
586525
587# gui target
588$(EMULATORGUI):   $(EMULATORDLL) $(OBJ)/mess/osd/windows/ui/guimain.o $(GUIRESFILE)
589   @echo Linking $@...
590   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mwindows $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/windows/ui/guimain.o $(GUIRESFILE) $(LIBS) -o $@
591
592# cli target
593$(EMULATORCLI):   $(EMULATORDLL) $(OBJ)/mess/osd/windows/climain.o
594   @echo Linking $@...
595   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mconsole $(FULLNAME)lib.$(DLLLINK) $(OBJ)/mess/osd/windows/climain.o $(LIBS) -o $@
596
597else
598
599$(EMULATORCLI):   $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU)  $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE)
600   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
601   @echo Linking $@...
602   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) -mconsole $^ $(LIBS) -o $@
603
604526endif
605527
606528
r1391r1392
640562   @echo Objective-C compiling $<...
641563   $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
642564endif
643
644mess.chm: $(MESSDOCS)
645   $(MESSDOCS) docs/wintoc.xml obj/help
646   $(HHC) obj\\help\\mess.hhp
647   @cp obj/help/mess.chm $@

Previous 15994 Revisions Next


© 1998-2018 The MESS Team