mirror of https://github.com/stella-emu/stella.git
I've finally started development on Stella again ...
Many changes to the makefile representing the 'SDL-ification' of the Stella codebase. Now there are 4 make options which should be self-explanatory: "linux, linux-gl, win32, win32-gl". The codebase now compiles under Linux (with gcc) and Windows (with MinGW) from the same makefile without any editing or modifications. So there is finally full cross-platform support. Next step is to fix the small OpenGL regressions in Windows, and finally move to the dreaded sound code. Then a new release ... git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@230 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
8524727d42
commit
b6325d98a0
|
@ -13,7 +13,7 @@
|
||||||
## See the file "license" for information on usage and redistribution of
|
## See the file "license" for information on usage and redistribution of
|
||||||
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
##
|
##
|
||||||
## $Id: makefile,v 1.47 2003-12-05 19:51:08 stephena Exp $
|
## $Id: makefile,v 1.48 2004-04-03 03:06:45 stephena Exp $
|
||||||
##============================================================================
|
##============================================================================
|
||||||
|
|
||||||
##============================================================================
|
##============================================================================
|
||||||
|
@ -27,43 +27,17 @@
|
||||||
### if none are provided, the defaults will be used
|
### if none are provided, the defaults will be used
|
||||||
OPTIMIZATIONS =
|
OPTIMIZATIONS =
|
||||||
|
|
||||||
### which system the SDL version is being compiled on
|
### to include joystick support
|
||||||
### you should only enable one at a time
|
|
||||||
SYSTEM_SDL = linux
|
|
||||||
#SYSTEM_SDL = windows
|
|
||||||
|
|
||||||
### which sound drivers to compile for the SDL version
|
|
||||||
### OSS is most compatible, SDL for platforms where OSS not available
|
|
||||||
### comment out all lines to completely disable sound
|
|
||||||
###
|
|
||||||
#SOUND_ALSA = 1
|
|
||||||
#SOUND_OSS = 1
|
|
||||||
SOUND_SDL = 1
|
|
||||||
|
|
||||||
### to include OpenGL video support (SDL)
|
|
||||||
OPENGL_SUPPORT = 1
|
|
||||||
|
|
||||||
### to include joystick support (SDL)
|
|
||||||
JOYSTICK_SUPPORT = 1
|
JOYSTICK_SUPPORT = 1
|
||||||
|
|
||||||
### to include support for saving snapshots in png format
|
### to include support for saving snapshots in png format
|
||||||
### (requires PNG library)
|
### (requires PNG library)
|
||||||
SNAPSHOT_SUPPORT = 1
|
# SNAPSHOT_SUPPORT = 1
|
||||||
|
|
||||||
### comment this out if your system doesn't
|
|
||||||
### have the gettimeofday function
|
|
||||||
# HAVE_GETTIMEOFDAY = 1
|
|
||||||
|
|
||||||
### to include support for game developers
|
### to include support for game developers
|
||||||
### enables some extra commandline options that allow the user
|
### enables some extra commandline options that allow the user
|
||||||
### to override some emulation defaults
|
### to override some emulation defaults
|
||||||
# DEVELOPER_SUPPORT = 1
|
DEVELOPER_SUPPORT = 1
|
||||||
|
|
||||||
### if your C++ compiler doesn't support the bool type
|
|
||||||
# BSPF_BOOL = 1
|
|
||||||
|
|
||||||
### if your want some timing information displayed when you exit the program
|
|
||||||
# SHOW_TIMING = 1
|
|
||||||
|
|
||||||
### you want a 6507 trace written to stdout
|
### you want a 6507 trace written to stdout
|
||||||
# DEBUG = 1
|
# DEBUG = 1
|
||||||
|
@ -76,22 +50,18 @@ SOUND_SDL = 1
|
||||||
CXX = g++
|
CXX = g++
|
||||||
LD = g++
|
LD = g++
|
||||||
|
|
||||||
LDFLAGS =
|
LDFLAGS = `sdl-config --cflags`
|
||||||
LDLIBS =
|
LDLIBS = `sdl-config --libs`
|
||||||
|
OBJECTS = mainSDL.o FrameBufferSDL.o FrameBufferSoft.o
|
||||||
|
OPTIONS =
|
||||||
|
EXE_NAME =
|
||||||
|
|
||||||
OBJS.SDL =
|
SRC = ..
|
||||||
OPTS.SDL =
|
CORE = $(SRC)/emucore
|
||||||
LIBS.SDL = `sdl-config --libs`
|
UI = $(SRC)/ui
|
||||||
CFLAGS.SDL = `sdl-config --cflags`
|
COMMON = $(SRC)/ui/common
|
||||||
|
|
||||||
OPTS.DOS = -DDOS
|
INCLUDES = -I. -I$(CORE) -I$(CORE)/m6502/src -I$(CORE)/m6502/src/bspf/src -I$(COMMON) -I$(UI)/sdl -I$(UI)/sound
|
||||||
|
|
||||||
SRC = ..
|
|
||||||
CORE = $(SRC)/emucore
|
|
||||||
UI = $(SRC)/ui
|
|
||||||
COMMON = $(SRC)/ui/common
|
|
||||||
|
|
||||||
INCLUDES = -I. -I$(CORE) -I$(CORE)/m6502/src -I$(CORE)/m6502/src/bspf/src -I$(COMMON)
|
|
||||||
|
|
||||||
## set some sane optimizations if none have been provided
|
## set some sane optimizations if none have been provided
|
||||||
ifndef OPTIMIZATIONS
|
ifndef OPTIMIZATIONS
|
||||||
|
@ -105,82 +75,23 @@ endif
|
||||||
FLAGS = $(OPTIMIZATIONS) -Wall -Wunused $(INCLUDES) $(SYS_INCLUDES)
|
FLAGS = $(OPTIMIZATIONS) -Wall -Wunused $(INCLUDES) $(SYS_INCLUDES)
|
||||||
|
|
||||||
## set the user-defined options
|
## set the user-defined options
|
||||||
ifdef BSPF_BOOL
|
#ifdef DEBUG
|
||||||
OPTS.DOS += -DBSPF_BOOL
|
# OPTS.SDL += -DDEBUG
|
||||||
endif
|
# OPTS.DOS += -DDEBUG
|
||||||
|
#endif
|
||||||
ifdef SHOW_TIMING
|
|
||||||
OPTS.SDL += -DSHOW_TIMING
|
|
||||||
OPTS.DOS += -DSHOW_TIMING
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef DEBUG
|
|
||||||
OPTS.SDL += -DDEBUG
|
|
||||||
OPTS.DOS += -DDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef JOYSTICK_SUPPORT
|
ifdef JOYSTICK_SUPPORT
|
||||||
OPTS.SDL += -DHAVE_JOYSTICK
|
OPTIONS += -DJOYSTICK_SUPPORT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef SNAPSHOT_SUPPORT
|
ifdef SNAPSHOT_SUPPORT
|
||||||
OBJS.SDL += Snapshot.o
|
OBJECTS += Snapshot.o
|
||||||
OPTS.SDL += -DSNAPSHOT_SUPPORT
|
OPTIONS += -DSNAPSHOT_SUPPORT
|
||||||
LIBS.SDL += -lpng -lz
|
LDLIBS += -lpng -lz
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef HAVE_GETTIMEOFDAY
|
|
||||||
OPTS.SDL += -DHAVE_GETTIMEOFDAY
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DEVELOPER_SUPPORT
|
ifdef DEVELOPER_SUPPORT
|
||||||
OPTS.SDL += -DDEVELOPER_SUPPORT
|
OPTIONS += -DDEVELOPER_SUPPORT
|
||||||
OPTS.DOS += -DDEVELOPER_SUPPORT
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SOUND_OSS), 1)
|
|
||||||
OPTS.SDL += -DSOUND_OSS
|
|
||||||
OBJS.SDL += SoundOSS.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SOUND_SDL), 1)
|
|
||||||
OPTS.SDL += -DSOUND_SDL
|
|
||||||
OBJS.SDL += SoundSDL.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SOUND_ALSA), 1)
|
|
||||||
OPTS.SDL += -DSOUND_ALSA
|
|
||||||
OBJS.SDL += SoundALSA.o
|
|
||||||
LIBS.SDL += -lasound
|
|
||||||
endif
|
|
||||||
|
|
||||||
##============================================================================
|
|
||||||
## Now figure out what has to be built for SDL
|
|
||||||
##============================================================================
|
|
||||||
ifeq ($(SYSTEM_SDL), linux)
|
|
||||||
CFLAGS.SDL += -L/usr/X11R6/lib
|
|
||||||
OPTS.SDL += -DBSPF_UNIX -DUNIX
|
|
||||||
LIBS.SDL += -lX11 -lXext
|
|
||||||
OBJS.SDL += SettingsUNIX.o
|
|
||||||
|
|
||||||
ifeq ($(OPENGL_SUPPORT), 1)
|
|
||||||
OPTS.SDL += -DDISPLAY_OPENGL
|
|
||||||
OBJS.SDL += FrameBufferGL.o
|
|
||||||
LIBS.SDL += -lGL
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SYSTEM_SDL), windows)
|
|
||||||
CFLAGS.SDL += ""
|
|
||||||
OPTS.SDL += -DBSPF_WIN32 -DWIN32
|
|
||||||
LIBS.SDL += ""
|
|
||||||
OBJS.SDL += SettingsWin32.o
|
|
||||||
|
|
||||||
ifeq ($(OPENGL_SUPPORT), 1)
|
|
||||||
OPTS.SDL += -DDISPLAY_OPENGL -DTEXTURES_ARE_LOST
|
|
||||||
OBJS.SDL += FrameBufferGL.o
|
|
||||||
LIBS.SDL += -lopengl32
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,31 +102,40 @@ default:
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "<version> is one of:"
|
@echo "<version> is one of:"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " dos DOS version using DJGPP"
|
@echo " linux Linux/UNIX version"
|
||||||
@echo " sdl SDL version (edit makefile for version)"
|
@echo " linux-gl Linux/UNIX version with OpenGL support"
|
||||||
|
@echo " win32 Windows 9x/ME/2000/XP version"
|
||||||
|
@echo " win32-gl Windows 9x/ME/2000/XP version with OpenGL support"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Hopefully new versions will be added soon!"
|
@echo "Hopefully new versions will be added soon!"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
dos:
|
linux:
|
||||||
make stella.exe \
|
make stella \
|
||||||
LD="gxx" \
|
EXE_NAME="stella" \
|
||||||
CXX="gcc" \
|
OPTIONS="$(OPTIONS) -DBSPF_UNIX -DUNIX -DHAVE_GETTIMEOFDAY" \
|
||||||
INCLUDES="$(INCLUDES) -I$(UI)/dos -I$(UI)/sound" \
|
OBJS="$(OBJECTS) SettingsUNIX.o"
|
||||||
OPTIONS="-DBSPF_DOS" \
|
|
||||||
OPTIONS+="$(OPTS.DOS)" \
|
|
||||||
LDFLAGS="" \
|
|
||||||
LDLIBS="" \
|
|
||||||
OBJS="mainDOS.o PCJoys.o SndDOS.o dos_sb.o vga.o"
|
|
||||||
|
|
||||||
sdl:
|
linux-gl:
|
||||||
make stella.sdl \
|
make stella \
|
||||||
INCLUDES="$(INCLUDES) -I$(UI)/sdl -I$(UI)/sound" \
|
EXE_NAME="stella" \
|
||||||
OPTIONS="$(OPTS.SDL)" \
|
LDFLAGS="$(LDFLAGS) -L/usr/X11R6/lib" \
|
||||||
LDFLAGS="$(CFLAGS.SDL)" \
|
LDLIBS="$(LDLIBS) -lGL" \
|
||||||
LDLIBS="$(LIBS.SDL)" \
|
OPTIONS="$(OPTIONS) -DBSPF_UNIX -DUNIX -DHAVE_GETTIMEOFDAY -DDISPLAY_OPENGL" \
|
||||||
OBJS="mainSDL.o FrameBufferSDL.o FrameBufferSoft.o" \
|
OBJS="$(OBJECTS) FrameBufferGL.o SettingsUNIX.o"
|
||||||
OBJS+="$(OBJS.SDL)"
|
|
||||||
|
win32:
|
||||||
|
make stella \
|
||||||
|
EXE_NAME="stella.exe" \
|
||||||
|
OPTIONS="$(OPTIONS) -DBSPF_WIN32 -DWIN32" \
|
||||||
|
OBJS="$(OBJECTS) SettingsWin32.o"
|
||||||
|
|
||||||
|
win32-gl:
|
||||||
|
make stella \
|
||||||
|
EXE_NAME="stella.exe" \
|
||||||
|
LDLIBS="$(LDLIBS) -lopengl32" \
|
||||||
|
OPTIONS="$(OPTIONS) -DBSPF_WIN32 -DWIN32 -DDISPLAY_OPENGL -DTEXTURES_ARE_LOST" \
|
||||||
|
OBJS="$(OBJECTS) FrameBufferGL.o SettingsWin32.o"
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -232,17 +152,9 @@ CORE_OBJS = Booster.o Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartDPC.o \
|
||||||
Serializer.o Deserializer.o TIASound.o EventHandler.o FrameBuffer.o \
|
Serializer.o Deserializer.o TIASound.o EventHandler.o FrameBuffer.o \
|
||||||
$(M6502_OBJS)
|
$(M6502_OBJS)
|
||||||
|
|
||||||
stella.exe: $(CORE_OBJS) $(OBJS)
|
stella: $(CORE_OBJS) $(OBJS)
|
||||||
$(LD) -o a.exe *.o $(LDFLAGS) $(LDLIBS)
|
$(LD) -o $(EXE_NAME) $(CORE_OBJS) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||||
exe2coff a.exe
|
strip $(EXE_NAME)
|
||||||
strip a
|
|
||||||
del stella.exe
|
|
||||||
copy /B $(DJGPP:\DJGPP.ENV=)\bin\pmodstub.exe+a stella.exe
|
|
||||||
del a
|
|
||||||
del a.exe
|
|
||||||
|
|
||||||
stella.sdl: $(CORE_OBJS) $(OBJS)
|
|
||||||
$(LD) -o stella.sdl $(CORE_OBJS) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
|
||||||
|
|
||||||
M6502Low.ins: $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4
|
M6502Low.ins: $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4
|
||||||
m4 $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4 > M6502Low.ins
|
m4 $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4 > M6502Low.ins
|
||||||
|
@ -253,14 +165,8 @@ M6502Hi.ins: $(CORE)/m6502/src/M6502Hi.m4 $(CORE)/m6502/src/M6502.m4
|
||||||
M6502Low.o: M6502Low.ins
|
M6502Low.o: M6502Low.ins
|
||||||
M6502Hi.o: M6502Hi.ins
|
M6502Hi.o: M6502Hi.ins
|
||||||
|
|
||||||
cleandos:
|
|
||||||
del *.o
|
|
||||||
del stella.exe
|
|
||||||
del M6502Low.ins
|
|
||||||
del M6502Hi.ins
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o stella stella.sdl stella.exe core
|
rm -f *.o stella stella.exe core
|
||||||
|
|
||||||
cleanall: clean
|
cleanall: clean
|
||||||
rm -f M6502Low.ins M6502Hi.ins
|
rm -f M6502Low.ins M6502Hi.ins
|
||||||
|
|
Loading…
Reference in New Issue