From 04758e38b6d3e94ee5c07e761c8aa10f3304b131 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Mon, 22 Jan 2018 21:01:35 +0000 Subject: [PATCH] Update make files and fix build for the various options (Harry Tuttle) --- Makefiles/Makefile.OSX | 64 +++-- Makefiles/Makefile.UNIX | 64 +++-- Makefiles/Makefile.Win32 | 170 ++++++------ Makefiles/Makefile.inc | 343 +++++++++++++++--------- Src/Debugger/CPUDebug.cpp | 1 + Src/Debugger/CPUDebug.h | 14 +- Src/Debugger/Debugger.cpp | 1 + Src/Debugger/{IO.cpp => DebuggerIO.cpp} | 2 +- Src/Debugger/{IO.h => DebuggerIO.h} | 0 Src/Debugger/Watch.cpp | 14 +- Src/Network/UDPSend.cpp | 6 + VS2008/Supermodel.vcxproj | 4 +- VS2008/Supermodel.vcxproj.filters | 12 +- 13 files changed, 396 insertions(+), 299 deletions(-) rename Src/Debugger/{IO.cpp => DebuggerIO.cpp} (95%) rename Src/Debugger/{IO.h => DebuggerIO.h} (100%) diff --git a/Makefiles/Makefile.OSX b/Makefiles/Makefile.OSX index e5a66cf..e229bd8 100644 --- a/Makefiles/Makefile.OSX +++ b/Makefiles/Makefile.OSX @@ -27,16 +27,13 @@ ############################################################################### -# Build Options -############################################################################### - -# -# Include console-based debugger in emulator ('yes' or 'no') -# -ENABLE_DEBUGGER = no - - -############################################################################### +# Build Options +############################################################################### + +DELETE = rm -d -r -f + + +############################################################################### # Platform Configuration # # Edit library and include paths as needed. @@ -51,27 +48,26 @@ LD = gcc # # SDL -# - -SDL_CFLAGS = -SDL_LDFLAGS = -framework SDL -framework AGL -framework OpenGL -framework GLUT -framework Cocoa - -# -# OSX-specific -# - -PLATFORM_CFLAGS = -DSUPERMODEL_OSX -DUSE_FILE32API -F/Library/Frameworks/ -PLATFORM_LDFLAGS = -lz -lm -lstdc++ -F/Library/Frameworks/ - - -############################################################################### -# Core Makefile -############################################################################### - -MUSASHI_OUTFILE = $(OBJ_DIR)/m68kmake - -include Makefiles/Makefile.inc - -clean: - rm $(OUTFILE) - rm -f $(OBJ_DIR)/* +# + +SDL_CFLAGS = +SDL_LIBS = -framework SDL -framework AGL -framework OpenGL -framework GLUT -framework Cocoa + +# +# OSX-specific +# + +PLATFORM_CFLAGS = $(SDL_CFLAGS) -DSUPERMODEL_OSX -DUSE_FILE32API -F/Library/Frameworks/ +PLATFORM_LDFLAGS = $(SDL_LIBS) -lz -lm -lstdc++ -F/Library/Frameworks/ + + +############################################################################### +# Core Makefile +############################################################################### + +include Makefiles/Makefile.inc + +clean: + $(SILENT)echo Cleaning up \"$(BIN_DIR)\" and \"$(OBJ_DIR)\"... + $(SILENT)$(DELETE) $(BIN_DIR) + $(SILENT)$(DELETE) $(OBJ_DIR) diff --git a/Makefiles/Makefile.UNIX b/Makefiles/Makefile.UNIX index 74e3370..9b3af4d 100644 --- a/Makefiles/Makefile.UNIX +++ b/Makefiles/Makefile.UNIX @@ -27,16 +27,13 @@ ############################################################################### -# Build Options -############################################################################### - -# -# Include console-based debugger in emulator ('yes' or 'no') -# -ENABLE_DEBUGGER = no - - -############################################################################### +# Build Options +############################################################################### + +DELETE = rm -d -r -f + + +############################################################################### # Platform Configuration # # Edit library and include paths as needed. @@ -51,27 +48,26 @@ LD = gcc # # SDL -# - -SDL_CFLAGS = `sdl-config --cflags` -SDL_LDFLAGS = `sdl-config --libs` - -# -# UNIX-specific -# - -PLATFORM_CFLAGS = -PLATFORM_LDFLAGS = -lGL -lGLU -lz -lm -lstdc++ - - -############################################################################### -# Core Makefile -############################################################################### - -MUSASHI_OUTFILE = $(OBJ_DIR)/m68kmake - -include Makefiles/Makefile.inc - -clean: - rm $(OUTFILE) - rm -f $(OBJ_DIR)/* +# + +SDL_CFLAGS = `sdl-config --cflags` +SDL_LIBS = `sdl-config --libs` + +# +# UNIX-specific +# + +PLATFORM_CFLAGS = $(SDL_CFLAGS) +PLATFORM_LDFLAGS = $(SDL_LIBS) -lGL -lGLU -lz -lm -lstdc++ + + +############################################################################### +# Core Makefile +############################################################################### + +include Makefiles/Makefile.inc + +clean: + $(SILENT)echo Cleaning up \"$(BIN_DIR)\" and \"$(OBJ_DIR)\"... + $(SILENT)$(DELETE) $(BIN_DIR) + $(SILENT)$(DELETE) $(OBJ_DIR) diff --git a/Makefiles/Makefile.Win32 b/Makefiles/Makefile.Win32 index fabcd7e..a72fb1f 100644 --- a/Makefiles/Makefile.Win32 +++ b/Makefiles/Makefile.Win32 @@ -31,85 +31,97 @@ ############################################################################### # -# Bitness of build ('32' or '64') -# -BITS = 64 - -# -# Include console-based debugger in emulator ('yes' or 'no') -# -ENABLE_DEBUGGER = no - - -############################################################################### +# Bitness of build ('32' or '64') +# +BITS = 64 +# First check if we're under MSYS2 or not, and then get bitness of CPU +ifeq ($(strip $(MSYSTEM)),) + ifeq ($(findstring 64,$(strip $(PROCESSOR_ARCHITECTURE))),) + BITS = 32 + endif +else + ifeq ($(findstring 32,$(strip $(MSYSTEM_CARCH))),32) + BITS = 32 + endif +endif +# Safety check: can be only '32' or '64' otherwise defaults to '64' +ifneq ($(filter $(strip $(BITS)),32 64),$(strip $(BITS))) + override BITS = 64 +endif + +# +# Use Bash or Windows Prompt shell commands? +# +DELETE = rm -d -r -f +ifeq ($(strip $(MSYSTEM)),) + DELETE = rmdir /s /q +endif + + +############################################################################### # Platform Configuration # # Edit library and include paths as needed. -############################################################################### - -# -# Toolchain -# -CC_64 = gcc -CXX_64 = g++ -LD_64 = g++ -CC_32 = gcc -CXX_32 = g++ -LD_32 = g++ - -# -# SDL -# - -SDL_INCLUDE_DIR_64 = c:\tdm-gcc-64\include\SDL -SDL_LIB_DIR_64 = c:\tdm-gcc-64\lib -SDL_INCLUDE_DIR_32 = -SDL_LIB_DIR_32 = - -# -# MinGW/Windows-specific -# - -PLATFORM_CFLAGS_64 = -DSUPERMODEL_WIN32 -PLATFORM_LDFLAGS_64 = -lmingw32 -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lwbemuuid -lz -PLATFORM_CFLAGS_32 = -DSUPERMODEL_WIN32 -PLATFORM_LDFLAGS_32 = -lmingw32 -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lwbemuuid -lz - - -############################################################################### -# Core Makefile -############################################################################### - -ifeq ($(strip $(BITS)),64) - CC = $(CC_64) - CXX = $(CXX_64) - LD = $(LD_64) - PLATFORM_CFLAGS = $(PLATFORM_CFLAGS_64) - PLATFORM_LDFLAGS = $(PLATFORM_LDFLAGS_64) - SDL_LDFLAGS = -L$(SDL_LIB_DIR_64) -lSDLmain -lSDL - SDL_CFLAGS = -I$(SDL_INCLUDE_DIR_64) -else - CC = $(CC_32) - CXX = $(CXX_32) - LD = $(LD_32) - PLATFORM_CFLAGS = $(PLATFORM_CFLAGS_32) - PLATFORM_LDFLAGS = $(PLATFORM_LDFLAGS_32) - SDL_LDFLAGS = -L$(SDL_LIB_DIR_32) -lSDLmain -lSDL - SDL_CFLAGS = -I$(SDL_INCLUDE_DIR_32) -endif - -PLATFORM_SRC_FILES = \ - Src/OSD/Windows/DirectInputSystem.cpp \ - Src/OSD/Windows/WinOutputs.cpp - -MUSASHI_OUTFILE = $(OBJ_DIR)/m68kmake.exe - -include Makefiles/Makefile.inc - -clean: - del $(BIN_DIR)\$(OUTFILE).exe - del $(OBJ_DIR)\*.d - del $(OBJ_DIR)\*.o - del $(OBJ_DIR)\*.c - del $(OBJ_DIR)\*.h - del $(OBJ_DIR)\*.exe +############################################################################### + +# +# Build environment +# + +# Leave empty if 'mingwXX' folder is located on the root filesystem +MINGW_ROOT = + +# 'mingw64' or 'mingw32' for respectively 64 or 32 bits builds. +# MSYS2 uses that scheme, customize it if necessary +MINGW_BASE = mingw$(strip $(BITS)) + +# The resulting 'mingwXX' base name for includes and libs +MINGW_DIR = $(strip $(MINGW_ROOT))/$(strip $(MINGW_BASE)) + +# +# Toolchain +# + +CC = gcc +CXX = g++ +LD = g++ + +# +# SDL +# +# +# (At least for SDL) The linked libs order is fundamental for a successful compiling! +# https://stackoverflow.com/questions/24596596/sdl-doesnt-compile-in-native-enviroment +# http://www.cplusplus.com/forum/beginner/110753/ +# + +SDL_INCLUDE_DIR = $(MINGW_DIR)/include/SDL +SDL_LIB_DIR = $(MINGW_DIR)/lib +SDL_LIBS = -lmingw32 -static-libgcc -static-libstdc++ -lSDLmain -lSDL -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid +SDL_CFLAGS = -D_GNU_SOURCE=1 -Dmain=SDL_main + +# +# MinGW/Windows-specific +# + +PLATFORM_INCLUDE_DIR = $(SDL_INCLUDE_DIR) $(MINGW_DIR)/include +PLATFORM_LIB_DIR = $(SDL_LIB_DIR) +PLATFORM_LIBS = -ldinput8 -lglew32 -lglu32 -lole32 -loleaut32 -lopengl32 -lwbemuuid -lws2_32 -lz +PLATFORM_CFLAGS = $(SDL_CFLAGS) -DSUPERMODEL_WIN32 $(addprefix -I,$(sort $(PLATFORM_INCLUDE_DIR))) +PLATFORM_LDFLAGS = -static -L$(sort $(PLATFORM_LIB_DIR)) $(SDL_LIBS) $(PLATFORM_LIBS) + + +############################################################################### +# Core Makefile +############################################################################### + +PLATFORM_SRC_FILES = \ + Src/OSD/Windows/DirectInputSystem.cpp \ + Src/OSD/Windows/WinOutputs.cpp + +include Makefiles/Makefile.inc + +clean: + $(SILENT)echo Cleaning up \"$(BIN_DIR)\" and \"$(OBJ_DIR)\"... + $(SILENT)$(DELETE) $(BIN_DIR) + $(SILENT)$(DELETE) $(OBJ_DIR) diff --git a/Makefiles/Makefile.inc b/Makefiles/Makefile.inc index 3208105..3e6ddcf 100644 --- a/Makefiles/Makefile.inc +++ b/Makefiles/Makefile.inc @@ -24,12 +24,61 @@ # # Core GNU Makefile, included by all (platform-specific) top-level Makefiles. # - - -############################################################################### -# Source Files -############################################################################### - + + +############################################################################### +# Build Options +############################################################################### + +# +# Verbose progression +# +VERBOSE = +ifneq ($(filter $(strip $(VERBOSE)),0 1),$(strip $(VERBOSE))) + override VERBOSE = +endif +SILENT = @ +ifeq ($(strip $(VERBOSE)),1) + SILENT = +endif + +# +# Enable render state analyser for the legacy 3D engine (will slow down emulation!) +# +DEBUG = +ifneq ($(filter $(strip $(DEBUG)),0 1),$(strip $(DEBUG))) + override DEBUG = +endif + +# +# Enable support for Model3 Net Board emulation +# +NET_BOARD = +ifneq ($(filter $(strip $(NET_BOARD)),0 1),$(strip $(NET_BOARD))) + override NET_BOARD = +endif + +# +# Enable Bart's new (experimental) Real3D frame timing +# +NEW_FRAME_TIMING = +ifneq ($(filter $(strip $(NEW_FRAME_TIMING)),0 1),$(strip $(NEW_FRAME_TIMING))) + override NEW_FRAME_TIMING = +endif + +# +# Include console-based debugger in emulator ('yes' or 'no') +# +ENABLE_DEBUGGER = +ifneq ($(filter $(strip $(ENABLE_DEBUGGER)),0 1),$(strip $(ENABLE_DEBUGGER))) + override ENABLE_DEBUGGER = +endif + + +############################################################################### +# Source Files +############################################################################### + SRC_FILES = \ Src/CPU/PowerPC/PPCDisasm.cpp \ Src/BlockFile.cpp \ @@ -106,96 +155,128 @@ SRC_FILES = \ Src/Util/ByteSwap.cpp \ Src/Util/ConfigBuilders.cpp \ Src/GameLoader.cpp \ - Src/Pkgs/tinyxml2.cpp \ - Src/ROMSet.cpp \ - $(PLATFORM_SRC_FILES) - -ifeq ($(strip $(ENABLE_DEBUGGER)),yes) - SRC_FILES += \ - Src/Debugger/Debugger.cpp \ - Src/Debug/ConsoleDebugger.cpp \ - Src/Debugger/SupermodelDebugger.cpp \ - Src/Debugger/CPUDebug.cpp \ - Src/Debugger/AddressTable.cpp \ + Src/Pkgs/tinyxml2.cpp \ + Src/ROMSet.cpp \ + $(PLATFORM_SRC_FILES) + +ifeq ($(strip $(NET_BOARD)),1) + SRC_FILES += \ + Src/Network/UDPReceive.cpp \ + Src/Network/UDPSend.cpp \ + Src/Network/WinSockWrap.cpp \ + Src/Network/NetBoard.cpp +endif + +ifeq ($(strip $(ENABLE_DEBUGGER)),1) + SRC_FILES += \ + Src/Debugger/Debugger.cpp \ + Src/Debugger/ConsoleDebugger.cpp \ + Src/Debugger/SupermodelDebugger.cpp \ + Src/Debugger/CPUDebug.cpp \ + Src/Debugger/AddressTable.cpp \ Src/Debugger/Breakpoint.cpp \ - Src/Debugger/CodeAnalyser.cpp \ - Src/Debugger/Exception.cpp \ - Src/Debugger/Interrupt.cpp \ - Src/Debugger/IO.cpp \ - Src/Debugger/Label.cpp \ - Src/Debugger/Register.cpp \ - Src/Debugger/Watch.cpp \ + Src/Debugger/CodeAnalyser.cpp \ + Src/Debugger/Exception.cpp \ + Src/Debugger/Interrupt.cpp \ + Src/Debugger/DebuggerIO.cpp \ + Src/Debugger/Label.cpp \ + Src/Debugger/Register.cpp \ + Src/Debugger/Watch.cpp \ Src/Debugger/CPU/PPCDebug.cpp \ Src/Debugger/CPU/68KDebug.cpp \ Src/Debugger/CPU/Musashi68KDebug.cpp \ - Src/Debugger/CPU/Z80Debug.cpp -endif - -OBJ_FILES = $(foreach file,$(SRC_FILES),$(OBJ_DIR)/$(basename $(notdir $(file))).o) - -# -# Deduce include directories from the source file list. The sort function + Src/Debugger/CPU/Z80Debug.cpp +endif + +# +# Sorted-path compile order +# +OBJ_FILES = $(foreach file,$(sort $(SRC_FILES)),$(OBJ_DIR)/$(basename $(notdir $(file))).o) + +# +# Deduce include directories from the source file list. The sort function # removes duplicates and is used to construct a set. # INCLUDE_DIRS = $(sort $(foreach file,$(SRC_FILES),$(dir $(file)))) ############################################################################### -# Output Locations -############################################################################### - -ifeq ($(strip $(BITS)),64) - OBJ_DIR = obj64 - BIN_DIR = bin64 -else ifeq ($(strip $(BITS)),32) - OBJ_DIR = obj32 - BIN_DIR = bin32 -else - OBJ_DIR = obj - BIN_DIR = bin -endif - -OUTFILE = Supermodel - - -############################################################################### -# Compiler Flags -############################################################################### - -CPPFLAGS = $(addprefix -I,$(INCLUDE_DIRS)) -DGLEW_STATIC -O3 #-DNEW_FRAME_TIMING -CFLAGS = $(SDL_CFLAGS) $(PLATFORM_CFLAGS) $(CPPFLAGS) -c -Wall -O3 -CXXFLAGS = $(CFLAGS) -std=c++11 -LDFLAGS = -o $(BIN_DIR)/$(OUTFILE) $(PLATFORM_LDFLAGS) $(SDL_LDFLAGS) -s - -# If built-in debugger enabled, need to define SUPERMODEL_DEBUGGER -ifeq ($(strip $(ENABLE_DEBUGGER)),yes) - PLATFORM_CFLAGS += -DSUPERMODEL_DEBUGGER -endif - - +# Output Locations +############################################################################### + +OBJ_DIR = obj$(strip $(BITS)) +BIN_DIR = bin$(strip $(BITS)) + +OUTFILE = supermodel +MUSASHI_OUTFILE = m68kmake + + +############################################################################### +# Compiler Flags +############################################################################### + +ARCH = -march=native -mfpmath=sse +BUILD_CFLAGS = +OPT = -O3 +#WARN = -Wall +WARN = -w +CSTD = -std=iso9899:2011 +CXXSTD = -std=c++11 + +COMMON_CFLAGS = -c $(ARCH) $(OPT) $(WARN) $(addprefix -I,$(sort $(INCLUDE_DIRS))) -DGLEW_STATIC + +CFLAGS = $(COMMON_CFLAGS) $(CSTD) +CXXFLAGS = $(PLATFORM_CFLAGS) $(COMMON_CFLAGS) $(BUILD_CFLAGS) $(CXXSTD) +LDFLAGS = -o $(BIN_DIR)/$(OUTFILE) $(PLATFORM_LDFLAGS) -s + +# If render state analyser is enabled, need to define DEBUG +ifeq ($(strip $(DEBUG)),1) + BUILD_CFLAGS += -DDEBUG +endif + +# If Net Board support is enabled, need to define NET_BOARD +ifeq ($(strip $(NET_BOARD)),1) + BUILD_CFLAGS += -DNET_BOARD +endif + +# If Bart's new frame timing is enabled, need to define NEW_FRAME_TIMING +ifeq ($(strip $(NEW_FRAME_TIMING)),1) + BUILD_CFLAGS += -DNEW_FRAME_TIMING +endif + +# If built-in debugger enabled, need to define SUPERMODEL_DEBUGGER +ifeq ($(strip $(ENABLE_DEBUGGER)),1) + BUILD_CFLAGS += -DSUPERMODEL_DEBUGGER +endif + + ############################################################################### # Targets ############################################################################### # # Default target: build Supermodel binary. Must be specified *before* the auto- -# generated dependencies because otherwise, make gets confused for some reason -# and thinks the default target is just one of the object files. -# -all: $(BIN_DIR) $(OBJ_DIR) $(OBJ_FILES) - $(info Linking Supermodel : $(BIN_DIR)/$(OUTFILE)) - @$(LD) $(OBJ_FILES) $(LDFLAGS) - -$(BIN_DIR): - $(info Creating directory : $(BIN_DIR)) - @mkdir $(BIN_DIR) - -$(OBJ_DIR): - $(info Creating directory : $(OBJ_DIR)) - @mkdir $(OBJ_DIR) - - -############################################################################### +# generated dependencies because otherwise, make gets confused for some reason +# and thinks the default target is just one of the object files. +# +all: $(BIN_DIR)/$(OUTFILE) + +$(BIN_DIR)/$(OUTFILE): $(BIN_DIR) $(OBJ_DIR) $(OBJ_FILES) + $(info --------------------------------------------------------------------------------) + $(info Linking Supermodel : $(BIN_DIR)/$(OUTFILE)) + $(SILENT)$(LD) $(OBJ_FILES) $(LDFLAGS) + $(info --------------------------------------------------------------------------------) + +$(BIN_DIR): + $(info Creating directory : $(BIN_DIR)) + $(SILENT)mkdir $(BIN_DIR) + +$(OBJ_DIR): + $(info Creating directory : $(OBJ_DIR)) + $(SILENT)mkdir $(OBJ_DIR) + + +############################################################################### # Rules ############################################################################### @@ -216,55 +297,59 @@ VPATH = $(INCLUDE_DIRS) # Compilation rules that both auto-generate the dependency files and compile # the source code. This technique is described in the reply by user "rr-" at: # https://stackoverflow.com/questions/8025766/makefile-auto-dependency-generation -# -$(OBJ_DIR)/%.o: %.cpp - $(info Generating dependencies: $< -> $(OBJ_DIR)/$(*F).d) - @$(CXX) -MM -MP -MT $(OBJ_DIR)/$(*F).o -MT $(OBJ_DIR)/$(*F).d $(CXXFLAGS) $< > $(OBJ_DIR)/$(*F).d - $(info Compiling : $< -> $@) - @$(CXX) $(CXXFLAGS) $< -o $@ - -$(OBJ_DIR)/%.o: %.c - $(info Generating dependencies: $< -> $(OBJ_DIR)/$(*F).d) - @$(CC) -MM -MP -MT $(OBJ_DIR)/$(*F).o -MT $(OBJ_DIR)/$(*F).d $(CPPFLAGS) $< > $(OBJ_DIR)/$(*F).d - $(info Compiling : $< -> $@) - @$(CC) $(CFLAGS) $< -o $@ - -# -# Musashi 68K emulator +# +$(OBJ_DIR)/%.o: %.cpp + $(info Generating dependencies: $< -> $(OBJ_DIR)/$(*F).d) + $(SILENT)$(CXX) -MM -MP -MT $(OBJ_DIR)/$(*F).o -MT $(OBJ_DIR)/$(*F).d $(CXXFLAGS) $< > $(OBJ_DIR)/$(*F).d + $(info Compiling : $< -> $@) + $(SILENT)$(CXX) $(CXXFLAGS) $< -o $@ + +$(OBJ_DIR)/%.o: %.c + $(info Generating dependencies: $< -> $(OBJ_DIR)/$(*F).d) + $(SILENT)$(CC) -MM -MP -MT $(OBJ_DIR)/$(*F).o -MT $(OBJ_DIR)/$(*F).d $(CFLAGS) $< > $(OBJ_DIR)/$(*F).d + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $(CFLAGS) $< -o $@ + + +# +# 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. -# - -MUSASHI_CFLAGS = -ISrc/CPU/68K/Musashi -I$(OBJ_DIR) -DINLINE="static inline" -Wno-unused-variable -MUSASHI_LDFLAGS = -o $(MUSASHI_OUTFILE) $(OBJ_DIR)/m68kmake.o - -$(MUSASHI_OUTFILE): Src/CPU/68K/Musashi/m68kmake.c Src/CPU/68K/Musashi/m68k_in.c - $(info Compiling : $< -> $(OBJ_DIR)/m68kmake.o) - @$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kmake.o - $(info Linking : $(MUSASHI_OUTFILE)) - @$(LD) $(MUSASHI_LDFLAGS) - -$(OBJ_DIR)/m68kops.h $(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kopnz.c: $(MUSASHI_OUTFILE) Src/CPU/68K/Musashi/m68k_in.c Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h - $(info Generating 68K emulator: $@) - @$(MUSASHI_OUTFILE) $(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 - $(info Compiling : $< -> $@) - @$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $(OBJ_DIR)/m68kcpu.o - -$(OBJ_DIR)/m68kops.o: $(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h $(MUSASHI_OUTFILE) - $(info Compiling : $< -> $@) - @$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ - -$(OBJ_DIR)/m68kopac.o: $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h $(MUSASHI_OUTFILE) - $(info Compiling : $< -> $@) - @$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ - -$(OBJ_DIR)/m68kopdm.o: $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h $(MUSASHI_OUTFILE) - $(info Compiling : $< -> $@) - @$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ - -$(OBJ_DIR)/m68kopnz.o: $(OBJ_DIR)/m68kopnz.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h $(MUSASHI_OUTFILE) - $(info Compiling : $< -> $@) - @$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ +# + +MUSASHI_CFLAGS = -ISrc/CPU/68K/Musashi -I$(OBJ_DIR) -DINLINE="static inline" -Wno-unused-variable +MUSASHI_LDFLAGS = -o $(OBJ_DIR)/$(MUSASHI_OUTFILE) $(OBJ_DIR)/m68kmake.o -s + +$(OBJ_DIR)/$(MUSASHI_OUTFILE): Src/CPU/68K/Musashi/m68kmake.c + $(info --------------------------------------------------------------------------------) + $(info Compiling : $< -> $(OBJ_DIR)/m68kmake.o) + $(SILENT)$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/m68kmake.o + $(info Linking : $(MUSASHI_OUTFILE)) + $(SILENT)$(LD) $(MUSASHI_LDFLAGS) + +$(OBJ_DIR)/m68kops.h: $(OBJ_DIR)/$(MUSASHI_OUTFILE) Src/CPU/68K/Musashi/m68k_in.c + $(info Generating 68K emulator: $@) + $(SILENT)$(OBJ_DIR)/$(MUSASHI_OUTFILE) $(OBJ_DIR) Src/CPU/68K/Musashi/m68k_in.c + +$(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kopnz.c: $(OBJ_DIR)/m68kops.h + +$(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 + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $(OBJ_DIR)/m68kcpu.o + +$(OBJ_DIR)/m68kops.o: $(OBJ_DIR)/m68kops.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ + +$(OBJ_DIR)/m68kopac.o: $(OBJ_DIR)/m68kopac.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ + +$(OBJ_DIR)/m68kopdm.o: $(OBJ_DIR)/m68kopdm.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ + +$(OBJ_DIR)/m68kopnz.o: $(OBJ_DIR)/m68kopnz.c $(OBJ_DIR)/m68kops.h Src/CPU/68K/Musashi/m68k.h Src/CPU/68K/Musashi/m68kconf.h + $(info Compiling : $< -> $@) + $(SILENT)$(CC) $< $(CFLAGS) $(MUSASHI_CFLAGS) -o $@ diff --git a/Src/Debugger/CPUDebug.cpp b/Src/Debugger/CPUDebug.cpp index b3ad29d..1b0c0f6 100644 --- a/Src/Debugger/CPUDebug.cpp +++ b/Src/Debugger/CPUDebug.cpp @@ -25,6 +25,7 @@ #ifdef SUPERMODEL_DEBUGGER +#include "Supermodel.h" #include "CPUDebug.h" #include "CodeAnalyser.h" #include "Label.h" diff --git a/Src/Debugger/CPUDebug.h b/Src/Debugger/CPUDebug.h index cf55531..aeb0c80 100644 --- a/Src/Debugger/CPUDebug.h +++ b/Src/Debugger/CPUDebug.h @@ -35,13 +35,13 @@ #include "CodeAnalyser.h" #include "AddressTable.h" #include "Breakpoint.h" -#include "Debugger.h" -#include "Exception.h" -#include "Interrupt.h" -#include "IO.h" -#include "Register.h" -#include "Watch.h" - +#include "Debugger.h" +#include "Exception.h" +#include "Interrupt.h" +#include "DebuggerIO.h" +#include "Register.h" +#include "Watch.h" + #ifdef DEBUGGER_HASBLOCKFILE #include "BlockFile.h" #endif // DEBUGGER_HASBLOCKFILE diff --git a/Src/Debugger/Debugger.cpp b/Src/Debugger/Debugger.cpp index 307fc63..9deb59b 100644 --- a/Src/Debugger/Debugger.cpp +++ b/Src/Debugger/Debugger.cpp @@ -25,6 +25,7 @@ #ifdef SUPERMODEL_DEBUGGER +#include "Supermodel.h" #include "Debugger.h" #include "CPUDebug.h" diff --git a/Src/Debugger/IO.cpp b/Src/Debugger/DebuggerIO.cpp similarity index 95% rename from Src/Debugger/IO.cpp rename to Src/Debugger/DebuggerIO.cpp index ab71b7f..9eb5b1c 100644 --- a/Src/Debugger/IO.cpp +++ b/Src/Debugger/DebuggerIO.cpp @@ -26,7 +26,7 @@ #ifdef SUPERMODEL_DEBUGGER #include "CPUDebug.h" -#include "IO.h" +#include "DebuggerIO.h" #include "Watch.h" namespace Debugger diff --git a/Src/Debugger/IO.h b/Src/Debugger/DebuggerIO.h similarity index 100% rename from Src/Debugger/IO.h rename to Src/Debugger/DebuggerIO.h diff --git a/Src/Debugger/Watch.cpp b/Src/Debugger/Watch.cpp index 53395dd..8f1b61a 100644 --- a/Src/Debugger/Watch.cpp +++ b/Src/Debugger/Watch.cpp @@ -24,13 +24,13 @@ */ #ifdef SUPERMODEL_DEBUGGER - -#include "CPUDebug.h" -#include "Debugger.h" -#include "IO.h" -#include "Watch.h" -#include - + +#include "CPUDebug.h" +#include "Debugger.h" +#include "DebuggerIO.h" +#include "Watch.h" +#include + using namespace std; namespace Debugger diff --git a/Src/Network/UDPSend.cpp b/Src/Network/UDPSend.cpp index e24ce9b..31f4adb 100644 --- a/Src/Network/UDPSend.cpp +++ b/Src/Network/UDPSend.cpp @@ -4,6 +4,12 @@ #include #include +#ifdef __GNUC__ +extern "C" { + WINSOCK_API_LINKAGE INT WSAAPI inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf); +} +#endif + namespace SMUDP { diff --git a/VS2008/Supermodel.vcxproj b/VS2008/Supermodel.vcxproj index 09c9c34..b608e70 100644 --- a/VS2008/Supermodel.vcxproj +++ b/VS2008/Supermodel.vcxproj @@ -301,7 +301,7 @@ xcopy /D /Y "$(ProjectDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDi - + @@ -527,7 +527,7 @@ xcopy /D /Y "$(ProjectDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDi - + diff --git a/VS2008/Supermodel.vcxproj.filters b/VS2008/Supermodel.vcxproj.filters index fad65c5..ce0b0e0 100644 --- a/VS2008/Supermodel.vcxproj.filters +++ b/VS2008/Supermodel.vcxproj.filters @@ -335,9 +335,6 @@ Source Files\Debugger - - Source Files\Debugger - Source Files\Debugger @@ -464,6 +461,9 @@ Source Files\Network + + Source Files\Debugger + @@ -718,9 +718,6 @@ Header Files\Debugger - - Header Files\Debugger - Header Files\Debugger @@ -862,6 +859,9 @@ Header Files\Network + + Header Files\Debugger +