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)
master
Aaron Giles 2010-01-13 16:27:27 +00:00
parent b53bb2c6ac
commit 4169b811db
1 changed files with 20 additions and 2 deletions

View File

@ -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)