Supermodel/Makefiles/Makefile.SDL.OSX.GCC

233 lines
8.8 KiB
Makefile
Raw Normal View History

##
## Supermodel
## A Sega Model 3 Arcade Emulator.
2016-04-15 23:54:58 +00:00
## Copyright 2011-2016 Bart Trzynadlowski, Nik Henson
##
## This file is part of Supermodel.
##
## Supermodel is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation, either version 3 of the License, or (at your option)
## any later version.
##
## Supermodel is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
## more details.
##
## You should have received a copy of the GNU General Public License along
## with Supermodel. If not, see <http://www.gnu.org/licenses/>.
##
#
# Makefile.SDL.OSX.GCC
#
# GNU Makefile for SDL port using GCC on Mac OS X.
#
###############################################################################
# Build Options
###############################################################################
#
# Include console-based debugger in emulator ('yes' or 'no')
#
ENABLE_DEBUGGER = no
###############################################################################
# Required Libraries
#
# Edit these paths as necessary.
###############################################################################
#
# SDL
#
SDL_LDFLAGS = -framework SDL -framework AGL -framework OpenGL -framework GLUT -framework Cocoa
SDL_INCLUDEPATH =
###############################################################################
# Outputs
###############################################################################
OUTFILE = Supermodel
OBJ_DIR = obj
2011-09-22 07:14:23 +00:00
BIN_DIR = bin
OUTFILE = $(BIN_DIR)/Supermodel
###############################################################################
# Compiler
###############################################################################
CC = gcc
OCC = gcc
LD = gcc
2016-04-15 23:54:58 +00:00
COMPILER_FLAGS = -I$(OBJ_DIR) -ISrc/ -ISrc/OSD -ISrc/OSD/SDL/ -ISrc/Pkgs/ -ISrc/CPU/68K/Musashi -ISrc/Sound/MPEG -c -Wall -O3 -DUSE_FILE32API -DSUPERMODEL_OSX -F/Library/Frameworks/
CFLAGS = $(COMPILER_FLAGS)
2016-04-15 23:54:58 +00:00
CPPFLAGS = $(COMPILER_FLAGS) -std=c++11
LFLAGS = -o $(OUTFILE) $(SDL_LDFLAGS) -lz -lm -lstdc++ -F/Library/Frameworks/
#
# Build options...
#
# Add compiler flags for various options
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
COMPILER_FLAGS += -DSUPERMODEL_DEBUGGER
endif
###############################################################################
# Build Instructions
###############################################################################
#
# Objects and Dependencies
#
HEADERS = Src/Supermodel.h Src/Games.h Src/OSD/SDL/Types.h
2011-09-22 07:14:23 +00:00
OBJ = $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Games.o $(OBJ_DIR)/Config.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o \
$(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o \
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/Real3D.o $(OBJ_DIR)/Legacy3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/TextureRefs.o \
$(OBJ_DIR)/New3D.o $(OBJ_DIR)/Mat4.o $(OBJ_DIR)/Model.o $(OBJ_DIR)/PolyHeader.o $(OBJ_DIR)/Texture.o $(OBJ_DIR)/TextureSheet.o $(OBJ_DIR)/VBO.o $(OBJ_DIR)/Vec.o $(OBJ_DIR)/R3DShader.o $(OBJ_DIR)/R3DFloat.o \
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o \
$(OBJ_DIR)/Model3.o $(OBJ_DIR)/ppc.o $(OBJ_DIR)/Main.o $(OBJ_DIR)/Audio.o $(OBJ_DIR)/Thread.o $(OBJ_DIR)/SoundBoard.o \
$(OBJ_DIR)/SCSP.o $(OBJ_DIR)/SCSPDSP.o $(OBJ_DIR)/68K.o $(OBJ_DIR)/m68kcpu.o $(OBJ_DIR)/m68kopnz.o $(OBJ_DIR)/m68kopdm.o \
$(OBJ_DIR)/m68kopac.o $(OBJ_DIR)/m68kops.o $(OBJ_DIR)/DSB.o $(OBJ_DIR)/Z80.o \
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/IRQ.o $(OBJ_DIR)/53C810.o $(OBJ_DIR)/PCI.o $(OBJ_DIR)/RTC72421.o $(OBJ_DIR)/DriveBoard.o \
$(OBJ_DIR)/MPC10x.o $(OBJ_DIR)/Input.o $(OBJ_DIR)/Inputs.o $(OBJ_DIR)/InputSource.o $(OBJ_DIR)/InputSystem.o \
$(OBJ_DIR)/InputTypes.o $(OBJ_DIR)/MultiInputSource.o $(OBJ_DIR)/SDLInputSystem.o \
Committing various small updates that have been hanging around in my source tree for a while now: - Added 'crosshairs' command line and config option. - Added 'vsync' command line and config option (so far only tested on NVidia cards on Windows 7 - other graphics drivers, O/Ss or driver settings may simply chose to ignore this). - Added fullscreen toggle within game using Alt+Enter key combination. - Added framework for lamp outputs and 'outputs' command line and config option. So far only the lamps for driving games are hooked up in the emulator (others to be added later). - Added an initial outputs implementation for Windows that sends MAMEHooker compatible messages (-outputs=win to enable) - Fixed fps calculation in Main.cpp that was producing incorrect results and so giving the impression that frame throttling wasn't working properly when in fact it was. - Fixed palette indexed colours as the index was always off by one, causing incorrect colours in various games, eg drivers' suits and flashing Start sign in Daytona 2. - Altered caching of models so that models with palette indexed colours use the dynamic cache rather than the static one. This is so that changes in palette indexed colours appear on screen, eg the flashing Start sign on the advanced course of Daytona 2 (although currently the START message itself is not visible due to other problems with texture decoding). - Fixed small bug in TileGen.cpp which meant both palettes were being completely recomputed pretty much with every frame. This was a significant performance hit, particularly as palette recomputation is currently being done in SyncSnapshots (it should be moved out of here at some point, although for now it's no big deal). - Made sure all OpenGL objects and resources are deleted in Render2D/3D destructors, in particular the deleting of the VBO buffer in DestroyModelCache. - Made sure that GLSL uniforms are always checked to see if they are bound before using them in order to stop unecessary (but harmless) GL errors. - Altered the default texture sheet handling to use a single large GL texture holding multiple Model3 texture sheets rather than multiple GL textures as before (if required, the old behaviour can still be selected with the mulisheet fragment shader). I believe this fixes the disappearing crosshairs/corrupt GL state problem which the multisheet fragment shader seemed to be triggering somehow. - Fixed a bug in debugger which meant memory watches were not triggering properly
2012-07-15 21:04:46 +00:00
$(OBJ_DIR)/Outputs.o \
$(OBJ_DIR)/amp_audio.o $(OBJ_DIR)/amp_dump.o $(OBJ_DIR)/amp_getbits.o $(OBJ_DIR)/amp_getdata.o $(OBJ_DIR)/amp_huffman.o \
$(OBJ_DIR)/amp_layer2.o $(OBJ_DIR)/amp_layer3.o $(OBJ_DIR)/amp_misc2.o $(OBJ_DIR)/amp_position.o $(OBJ_DIR)/amp_transform.o \
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/amp_util.o \
$(OBJ_DIR)/Crypto.o \
$(OBJ_DIR)/Format.o \
$(OBJ_DIR)/Logger.o \
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/SDLMain_tmpl.o
# If built-in debugger enabled, include all debugging classes
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
OBJ += $(OBJ_DIR)/Debugger.o $(OBJ_DIR)/ConsoleDebugger.o $(OBJ_DIR)/SupermodelDebugger.o $(OBJ_DIR)/CPUDebug.o \
$(OBJ_DIR)/AddressTable.o $(OBJ_DIR)/Breakpoint.o $(OBJ_DIR)/CodeAnalyser.o $(OBJ_DIR)/Exception.o \
$(OBJ_DIR)/Interrupt.o $(OBJ_DIR)/IO.o $(OBJ_DIR)/Label.o $(OBJ_DIR)/Register.o $(OBJ_DIR)/Watch.o \
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/PPCDebug.o $(OBJ_DIR)/68KDebug.o $(OBJ_DIR)/Musashi68KDebug.o $(OBJ_DIR)/Z80Debug.o
endif
#
2011-09-22 07:14:23 +00:00
# Targets
#
2011-09-22 07:14:23 +00:00
all: $(BIN_DIR) $(OBJ_DIR) $(OBJ)
$(LD) $(LFLAGS) $(OBJ_LIBS) $(OBJ)
2011-09-22 07:14:23 +00:00
$(BIN_DIR):
mkdir $(BIN_DIR)
$(OBJ_DIR):
mkdir $(OBJ_DIR)
clean:
rm -f $(OUTFILE)
2011-09-22 07:14:23 +00:00
rm -f $(OBJ_DIR)/*.*
#
# Musashi 68K emulator
#
# All generated source files are emitted to the object directory. For MSVC,
# INLINE must be redefined as "static __inline", which is the syntax in C mode.
#
$(OBJ_DIR)/m68kmake: Src/CPU/68K/Musashi/m68kmake.c
2011-09-22 07:14:23 +00:00
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kmake.o
$(LD) $(OBJ_DIR)/m68kmake.o -o $(OBJ_DIR)/m68kmake
$(OBJ_DIR)/m68kops.h: $(OBJ_DIR)/m68kmake Src/CPU/68K/Musashi/m68k_in.c
$(OBJ_DIR)/m68kmake $(OBJ_DIR) Src/CPU/68K/Musashi/m68k_in.c
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/m68kcpu.o: Src/CPU/68K/Musashi/m68kcpu.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h Src/CPU/68K/Musashi/m68kctx.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kcpu.o -I$(OBJ_DIR) -ISrc/CPU/68K/Musashi -DINLINE="static inline"
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/m68kops.o: $(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kmake $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h Src/CPU/68K/Musashi/m68kctx.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kops.o -ISrc/CPU/68K/Musashi -DINLINE="static inline"
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/m68kopac.o: $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kmake $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h Src/CPU/68K/Musashi/m68kctx.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopac.o -ISrc/CPU/68K/Musashi -DINLINE="static inline"
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/m68kopdm.o: $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kmake $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h Src/CPU/68K/Musashi/m68kctx.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopdm.o -ISrc/CPU/68K/Musashi -DINLINE="static inline"
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/m68kopnz.o: $(OBJ_DIR)/m68kopnz.c $(OBJ_DIR)/m68kmake $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h Src/CPU/68K/Musashi/m68kctx.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopnz.o -ISrc/CPU/68K/Musashi -DINLINE="static inline"
2011-09-22 07:14:23 +00:00
#
# Rules for Supermodel C++ code
#
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Model3/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/Graphics/%.cpp Src/Graphics/Shaders2D.h
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Graphics/Legacy3D/%.cpp Src/Graphics/Legacy3D/%.h Src/Graphics/Legacy3D/Shaders3D.h
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Graphics/Legacy3D/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Graphics/New3D/%.cpp Src/Graphics/New3D/%.h
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Sound/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Debugger/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Debugger/CPU/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/CPU/PowerPC/%.cpp Src/CPU/PowerPC/ppc.h Src/CPU/PowerPC/ppc603.c Src/CPU/PowerPC/ppc_ops.c Src/CPU/PowerPC/ppc_ops.h
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/CPU/68K/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/CPU/Z80/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Inputs/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/OSD/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/OSD/SDL/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/OSD/Windows/%.cpp
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/Pkgs/%.c
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/$(*F).o
2016-04-15 23:54:58 +00:00
$(OBJ_DIR)/%.o: Src/Util/%.cpp Src/Util/%.h
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/OSD/SDL/%.m $(HEADERS)
$(OCC) -x objective-c++ $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
2011-09-22 07:14:23 +00:00
#
# AMP MPEG decoder library
#
# To eliminate name conflicts, object files have the prefix "amp_" attached.
#
$(OBJ_DIR)/amp_%.o: Src/Sound/MPEG/%.cpp Src/Sound/MPEG/%.h
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/amp_$(*F).o
2011-09-22 07:14:23 +00:00
$(OBJ_DIR)/amp_%.o: Src/Sound/MPEG/%.cpp
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/amp_$(*F).o