diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..9b93d19a9 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# Makefile emulation for the SCons build system + +#SCONSFLAGS="sdlmixer=1" + +all: build + +info: + @LANG=C svn info | grep '^Revision:' | cut -d' ' -f2 | xargs echo 'Based on revision' + +build: + scons $(SCONSFLAGS) + +install: + scons install + +clean: + scons -c + +distclean: clean diff --git a/SConstruct b/SConstruct index da1f0d0d0..901deb72d 100755 --- a/SConstruct +++ b/SConstruct @@ -6,14 +6,19 @@ import os PROGRAM_NAME = 'D1X-Rebirth' -#SVN_REVISION = os.popen('echo -n `LANG=C svn info | grep Revision | cut -d\ -f2`').read() +#SVN_REVISION = os.popen('echo -n `LANG=C svn info | grep ^Revision | cut -d\ -f2`').read() # version number D1XMAJOR = 0 D1XMINOR = 51 + +# optional micro revision: set it to SVN_REVISION if available, zero otherwise. +D1XMICRO = 0 #D1XMICRO = int(SVN_REVISION) VERSION_STRING = ' v' + str(D1XMAJOR) + '.' + str(D1XMINOR) +if (D1XMICRO): + VERSION_STRING += '.' + str(D1XMICRO) print '\n===== ' + PROGRAM_NAME + VERSION_STRING + ' =====\n' @@ -318,13 +323,16 @@ env.ParseConfig('sdl-config --cflags') env.ParseConfig('sdl-config --libs') env.Append(CPPFLAGS = ['-Wall', '-funsigned-char']) env.Append(CPPDEFINES = [('D1XMAJOR', '\\"' + str(D1XMAJOR) + '\\"'), ('D1XMINOR', '\\"' + str(D1XMINOR) + '\\"')]) -#env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')]) env.Append(CPPDEFINES = [('USE_SDLMIXER', sdlmixer)]) env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', 'SUPPORTS_NET_IP', '__SDL__', 'SDL_INPUT', 'SDL_AUDIO', '_REENTRANT']) env.Append(CPPPATH = ['include', 'main', 'arch/sdl/include']) generic_libs = ['SDL'] sdlmixerlib = ['SDL_mixer'] +if (D1XMICRO): + env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')]) + + # windows or *nix? if sys.platform == 'win32': print "compiling on Windows" diff --git a/arch/sdl/mixmusic.c b/arch/sdl/mixmusic.c index c0c084985..09911ec67 100644 --- a/arch/sdl/mixmusic.c +++ b/arch/sdl/mixmusic.c @@ -18,7 +18,7 @@ #include #include "cfile.h" -#define MIX_MUSIC_DEBUG 1 +#define MIX_MUSIC_DEBUG 0 #define MUSIC_FADE_TIME 500 //milliseconds #define MUSIC_EXTENSION_ARG "-music_ext"