2012-01-18 05:28:34 +00:00
|
|
|
##
|
|
|
|
## Supermodel
|
|
|
|
## A Sega Model 3 Arcade Emulator.
|
|
|
|
## Copyright 2011 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.Win32.GCC
|
|
|
|
#
|
2012-02-06 02:54:43 +00:00
|
|
|
# GNU Makefile for SDL port using GCC (MinGW) on Windows.
|
2012-01-18 05:28:34 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Build Options
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Bitness of build ('32' or '64')
|
|
|
|
#
|
|
|
|
BITS = 64
|
|
|
|
|
|
|
|
#
|
|
|
|
# Include console-based debugger in emulator ('yes' or 'no')
|
|
|
|
#
|
2016-03-22 03:43:55 +00:00
|
|
|
ENABLE_DEBUGGER = no
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Required Libraries
|
|
|
|
#
|
|
|
|
# Edit these paths as necessary.
|
|
|
|
###############################################################################
|
|
|
|
|
2016-03-21 04:10:14 +00:00
|
|
|
#
|
|
|
|
# Boost 1.55
|
|
|
|
#
|
|
|
|
BOOST_INCLUDEPATH = /mingw64/boost_1_55_0
|
|
|
|
|
2012-01-18 05:28:34 +00:00
|
|
|
#
|
|
|
|
# SDL
|
|
|
|
#
|
|
|
|
ifeq ($(strip $(BITS)),64)
|
|
|
|
SDL_LIBPATH = /mingw64/lib64
|
|
|
|
SDL_INCLUDEPATH = /mingw64/x86_64-w64-mingw32/include/SDL
|
|
|
|
else
|
|
|
|
SDL_LIBPATH = /mingw/lib
|
|
|
|
SDL_INCLUDEPATH = /mingw/include/SDL
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Microsoft Windows SDK
|
|
|
|
#
|
|
|
|
ifeq ($(strip $(BITS)),64)
|
|
|
|
WINSDK_LIBPATH = /Program\ Files/Microsoft\ SDKs/Windows/v7.0/Lib/x64
|
|
|
|
else
|
|
|
|
WINSDK_LIBPATH = /Program\ Files/Microsoft\ SDKs/Windows/v7.0/Lib
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Outputs
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
ifeq ($(strip $(BITS)),64)
|
|
|
|
OBJ_DIR = obj64
|
|
|
|
BIN_DIR = bin64
|
|
|
|
else
|
|
|
|
OBJ_DIR = obj
|
|
|
|
BIN_DIR = bin
|
|
|
|
endif
|
|
|
|
|
2012-01-18 05:58:11 +00:00
|
|
|
OUTFILE = $(BIN_DIR)\Supermodel.exe
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Compiler and Linker
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
CC = gcc
|
2012-02-06 02:54:43 +00:00
|
|
|
CXX = g++
|
2012-01-18 05:28:34 +00:00
|
|
|
LD = g++
|
2016-03-21 04:10:14 +00:00
|
|
|
COMPILER_FLAGS = -I$(SDL_INCLUDEPATH) -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -O3
|
2012-01-18 05:28:34 +00:00
|
|
|
CFLAGS = $(COMPILER_FLAGS)
|
2016-03-21 04:10:14 +00:00
|
|
|
CPPFLAGS = $(COMPILER_FLAGS) -I$(BOOST_INCLUDEPATH) -std=c++11
|
|
|
|
LFLAGS = -o $(OUTFILE) $(OBJ) -L$(SDL_LIBPATH) -lmingw32 -lSDLmain -lSDL -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lz -l:$(WINSDK_LIBPATH)/WbemUuid.lib -s
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build options...
|
|
|
|
#
|
|
|
|
|
|
|
|
# Add compiler flags for various options
|
|
|
|
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
|
|
|
|
COMPILER_FLAGS += -DSUPERMODEL_DEBUGGER
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Build Instructions
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Objects and Dependencies
|
|
|
|
#
|
|
|
|
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-03-21 04:10:14 +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)/Render2D.o $(OBJ_DIR)/TileGen.o \
|
2012-01-18 05:28:34 +00:00
|
|
|
$(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 \
|
|
|
|
$(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 $(OBJ_DIR)/DirectInputSystem.o \
|
2012-07-15 21:04:46 +00:00
|
|
|
$(OBJ_DIR)/Outputs.o $(OBJ_DIR)/WinOutputs.o \
|
2012-01-18 05:28:34 +00:00
|
|
|
$(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 \
|
|
|
|
$(OBJ_DIR)/amp_util.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 \
|
|
|
|
$(OBJ_DIR)/PPCDebug.o $(OBJ_DIR)/68KDebug.o $(OBJ_DIR)/Musashi68KDebug.o $(OBJ_DIR)/Z80Debug.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Targets
|
|
|
|
#
|
|
|
|
all: $(BIN_DIR) $(OBJ_DIR) $(OBJ)
|
|
|
|
$(LD) $(LFLAGS)
|
|
|
|
|
2016-03-21 04:10:14 +00:00
|
|
|
ppcd: $(BIN_DIR) $(OBJ_DIR)
|
|
|
|
$(CXX) Src/CPU/PowerPC/PPCDisasm.cpp $(CPPFLAGS) -DSTANDALONE -o $(OBJ_DIR)/ppcd.o
|
|
|
|
$(LD) -o $(BIN_DIR)/ppcd.exe -mconsole $(OBJ_DIR)/ppcd.o
|
|
|
|
|
2012-01-18 05:28:34 +00:00
|
|
|
$(BIN_DIR):
|
|
|
|
mkdir $(BIN_DIR)
|
|
|
|
|
|
|
|
$(OBJ_DIR):
|
|
|
|
mkdir $(OBJ_DIR)
|
|
|
|
|
|
|
|
clean:
|
2012-01-18 05:58:11 +00:00
|
|
|
del $(OUTFILE)
|
|
|
|
del $(OBJ_DIR)\*.o
|
|
|
|
del $(OBJ_DIR)\*.c
|
|
|
|
del $(OBJ_DIR)\*.h
|
|
|
|
del $(OBJ_DIR)\*.exe
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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.exe: Src/CPU/68K/Musashi/m68kmake.c
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kmake.o
|
|
|
|
$(LD) -o $(OBJ_DIR)/m68kmake.exe -mconsole $(OBJ_DIR)/m68kmake.o
|
|
|
|
|
|
|
|
$(OBJ_DIR)/m68kops.h: $(OBJ_DIR)/m68kmake.exe Src/CPU/68K/Musashi/m68k_in.c
|
|
|
|
$(OBJ_DIR)/m68kmake.exe $(OBJ_DIR) Src/CPU/68K/Musashi/m68k_in.c
|
|
|
|
|
|
|
|
$(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
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kcpu.o -I "$(OBJ_DIR)" -I "Src\CPU\68K\Musashi"
|
|
|
|
|
|
|
|
$(OBJ_DIR)/m68kops.o: $(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kmake.exe $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kops.o -I "Src\CPU\68K\Musashi"
|
|
|
|
|
|
|
|
$(OBJ_DIR)/m68kopac.o: $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kmake.exe $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopac.o -I "Src\CPU\68K\Musashi"
|
|
|
|
|
|
|
|
$(OBJ_DIR)/m68kopdm.o: $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kmake.exe $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopdm.o -I "Src\CPU\68K\Musashi"
|
|
|
|
|
|
|
|
$(OBJ_DIR)/m68kopnz.o: $(OBJ_DIR)/m68kopnz.c $(OBJ_DIR)/m68kmake.exe $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kopnz.o -I "Src\CPU\68K\Musashi"
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Rules for Supermodel C++ code
|
|
|
|
#
|
|
|
|
$(OBJ_DIR)/%.o: Src/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Model3/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
2016-03-21 04:10:14 +00:00
|
|
|
$(OBJ_DIR)/%.o: Src/Graphics/%.cpp Src/Graphics/Shaders2D.h
|
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
|
|
|
|
2016-03-22 03:43:55 +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
|
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Graphics/Legacy3D/%.cpp
|
2016-03-21 04:10:14 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Graphics/New3D/%.cpp Src/Graphics/New3D/%.h
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Sound/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Debugger/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Debugger/CPU/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
2012-02-06 02:54:43 +00:00
|
|
|
$(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
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/CPU/68K/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/CPU/Z80/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Inputs/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
2012-07-16 02:27:55 +00:00
|
|
|
$(OBJ_DIR)/%.o: Src/OSD/%.cpp
|
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
|
|
|
|
2012-01-18 05:28:34 +00:00
|
|
|
$(OBJ_DIR)/%.o: Src/OSD/SDL/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/OSD/Windows/%.cpp
|
2012-02-06 02:54:43 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
|
2012-01-18 05:28:34 +00:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: Src/Pkgs/%.c
|
|
|
|
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/$(*F).o
|
|
|
|
|
|
|
|
#
|
|
|
|
# AMP MPEG decoder library
|
|
|
|
#
|
|
|
|
# To eliminate name conflicts, object files have the prefix "amp_" attached.
|
|
|
|
#
|
|
|
|
$(OBJ_DIR)/amp_%.o: Src/Sound/MPEG/%.cpp
|
2012-02-23 23:20:21 +00:00
|
|
|
$(CXX) $< $(CPPFLAGS) -o $(OBJ_DIR)/amp_$(*F).o
|