From 4169b811dbab789f9cda5d92af3605d943860c34 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 13 Jan 2010 16:27:27 +0000 Subject: [PATCH] Makefile changes: 1. If OSD is not defined, we look for the built-in Windows environment variable 'OS' and if it is set to 'Windows_NT', we assume OSD=windows; otherwise we assume OSD=sdl. 2. If TARGETOS is not defined, we look for the same variable and set TARGETOS=win32 if it is set to 'Windows_NT'. 3. Windows SDL builds have an 'sdl' prefix on the executable so they can live side-by-side. The upshot of this is that on Windows systems: make -> standard Windows build producing mame.exe make OSD=sdl -> SDL Windows builds producing sdlmame.exe On non-Windows systems: make -> SDL build by default (don't need to say OSD=sdl) --- makefile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 22fc0a6ed16..910aa0be3fb 100644 --- a/makefile +++ b/makefile @@ -40,7 +40,12 @@ endif #------------------------------------------------- ifndef OSD +ifeq ($(OS),Windows_NT) OSD = windows +TARGETOS = win32 +else +OSD = sdl +endif endif ifndef CROSS_BUILD_OSD @@ -56,7 +61,7 @@ endif #------------------------------------------------- ifndef TARGETOS -ifeq ($(OSD),windows) +ifeq ($(OS),Windows_NT) TARGETOS = win32 else TARGETOS = unix @@ -113,6 +118,7 @@ endif # MACOSX_USE_LIBSDL = 1 + #------------------------------------------------- # specify build options; see each option below # for details @@ -205,6 +211,18 @@ RM = @rm -f # form the name of the executable #------------------------------------------------- +# reset all internal prefixes/suffixes +PREFIXSDL = +SUFFIX64 = +SUFFIXDEBUG = + +# Windows SDL builds get an SDL prefix +ifeq ($(OSD),sdl) +ifeq ($(TARGETOS),win32) +PREFIXSDL = sdl +endif +endif + # 64-bit builds get a '64' suffix ifdef PTR64 SUFFIX64 = 64 @@ -224,7 +242,7 @@ NAME = $(TARGET)$(SUBTARGET) endif # fullname is prefix+name+suffix+suffix64+suffixdebug -FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG) +FULLNAME = $(PREFIX)$(PREFIXSDL)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG) # add an EXE suffix to get the final emulator name EMULATOR = $(FULLNAME)$(EXE)