2006-07-27 09:46:44 +00:00
|
|
|
#SConstruct
|
|
|
|
|
|
|
|
# needed imports
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
2006-10-17 20:52:09 +00:00
|
|
|
PROGRAM_NAME = 'D1X-Rebirth'
|
|
|
|
|
|
|
|
#SVN_REVISION = os.popen('echo -n `LANG=C svn info | grep Revision | cut -d\ -f2`').read()
|
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
# version number
|
|
|
|
D1XMAJOR = 0
|
2006-10-10 10:41:49 +00:00
|
|
|
D1XMINOR = 50
|
2006-10-17 20:52:09 +00:00
|
|
|
#D1XMICRO = int(SVN_REVISION)
|
|
|
|
|
|
|
|
VERSION_STRING = ' v' + str(D1XMAJOR) + '.' + str(D1XMINOR)
|
|
|
|
|
|
|
|
print '\n===== ' + PROGRAM_NAME + VERSION_STRING + ' =====\n'
|
|
|
|
|
|
|
|
# installation path
|
|
|
|
PREFIX = '/usr/local/'
|
|
|
|
BIN_SUBDIR = 'games/'
|
|
|
|
DATA_SUBDIR = 'share/games/d1x-rebirth/'
|
|
|
|
BIN_DIR = PREFIX + BIN_SUBDIR
|
|
|
|
DATA_DIR = PREFIX + DATA_SUBDIR
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# command-line parms
|
2006-10-17 20:52:09 +00:00
|
|
|
sharepath = str(ARGUMENTS.get('sharepath', DATA_DIR))
|
2006-07-27 09:46:44 +00:00
|
|
|
debug = int(ARGUMENTS.get('debug', 0))
|
2006-07-28 19:23:59 +00:00
|
|
|
profiler = int(ARGUMENTS.get('profiler', 0))
|
2006-07-27 09:46:44 +00:00
|
|
|
sdl_only = int(ARGUMENTS.get('sdl_only', 0))
|
|
|
|
no_asm = int(ARGUMENTS.get('no_asm', 0))
|
|
|
|
editor = int(ARGUMENTS.get('editor', 0))
|
2006-10-06 00:12:16 +00:00
|
|
|
shareware = int(ARGUMENTS.get('shareware', 0))
|
2006-10-17 20:52:09 +00:00
|
|
|
sdlmixer = int(ARGUMENTS.get('sdlmixer', 0))
|
2006-11-22 05:35:10 +00:00
|
|
|
arm = int(ARGUMENTS.get('arm', 0))
|
|
|
|
gp2x = int(ARGUMENTS.get('gp2x', 0))
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# general source files
|
|
|
|
common_sources = [
|
|
|
|
'2d/2dsline.c',
|
|
|
|
'2d/bitblt.c',
|
|
|
|
'2d/bitmap.c',
|
|
|
|
'2d/box.c',
|
|
|
|
'2d/canvas.c',
|
|
|
|
'2d/circle.c',
|
|
|
|
'2d/disc.c',
|
|
|
|
'2d/font.c',
|
|
|
|
'2d/gpixel.c',
|
|
|
|
'2d/ibitblt.c',
|
|
|
|
'2d/line.c',
|
|
|
|
'2d/palette.c',
|
|
|
|
'2d/pcx.c',
|
|
|
|
'2d/pixel.c',
|
|
|
|
'2d/poly.c',
|
|
|
|
'2d/rect.c',
|
|
|
|
'2d/rle.c',
|
|
|
|
'2d/scalec.c',
|
|
|
|
'2d/tmerge.c',
|
|
|
|
'3d/clipper.c',
|
|
|
|
'3d/draw.c',
|
|
|
|
'3d/globvars.c',
|
|
|
|
'3d/instance.c',
|
|
|
|
'3d/interp.c',
|
|
|
|
'3d/matrix.c',
|
|
|
|
'3d/points.c',
|
|
|
|
'3d/rod.c',
|
|
|
|
'3d/setup.c',
|
2007-01-12 16:31:25 +00:00
|
|
|
'arch/sdl/event.c',
|
|
|
|
'arch/sdl/init.c',
|
|
|
|
'arch/sdl/joy.c',
|
|
|
|
'arch/sdl/joydefs.c',
|
|
|
|
'arch/sdl/key.c',
|
|
|
|
'arch/sdl/mouse.c',
|
2006-07-27 09:46:44 +00:00
|
|
|
'cfile/cfile.c',
|
|
|
|
'iff/iff.c',
|
|
|
|
'main/ai.c',
|
|
|
|
'main/aipath.c',
|
2006-10-06 16:34:53 +00:00
|
|
|
'main/digiobj.c',
|
2006-07-27 09:46:44 +00:00
|
|
|
'main/args.c',
|
|
|
|
'main/automap.c',
|
|
|
|
'main/ban.c',
|
|
|
|
'main/bm.c',
|
|
|
|
'main/bmread.c',
|
|
|
|
'main/cdplay.c',
|
|
|
|
'main/cntrlcen.c',
|
|
|
|
'main/collide.c',
|
|
|
|
'main/command.c',
|
|
|
|
'main/config.c',
|
|
|
|
'main/controls.c',
|
|
|
|
'main/credits.c',
|
|
|
|
'main/custom.c',
|
|
|
|
'main/d_conv.c',
|
|
|
|
'main/d_gamecv.c',
|
|
|
|
'main/dumpmine.c',
|
|
|
|
'main/effects.c',
|
|
|
|
'main/endlevel.c',
|
|
|
|
'main/fireball.c',
|
|
|
|
'main/fuelcen.c',
|
|
|
|
'main/fvi.c',
|
|
|
|
'main/game.c',
|
|
|
|
'main/gamefont.c',
|
|
|
|
'main/gameseg.c',
|
|
|
|
'main/gameseq.c',
|
|
|
|
'main/gauges.c',
|
|
|
|
'main/hash.c',
|
|
|
|
'main/hostage.c',
|
|
|
|
'main/hud.c',
|
|
|
|
'main/hudlog.c',
|
|
|
|
'main/ignore.c',
|
|
|
|
'main/inferno.c',
|
|
|
|
'main/ip_base.cpp',
|
|
|
|
'main/ipclienc.c',
|
|
|
|
'main/ipclient.cpp',
|
|
|
|
'main/ipx_drv.c',
|
|
|
|
'main/kconfig.c',
|
|
|
|
'main/kmatrix.c',
|
|
|
|
'main/laser.c',
|
|
|
|
'main/lighting.c',
|
|
|
|
'main/m_inspak.c',
|
|
|
|
'main/menu.c',
|
|
|
|
'main/mglobal.c',
|
|
|
|
'main/mission.c',
|
|
|
|
'main/mlticntl.c',
|
|
|
|
'main/modem.c',
|
|
|
|
'main/morph.c',
|
|
|
|
'main/multi.c',
|
|
|
|
'main/multibot.c',
|
|
|
|
'main/multipow.c',
|
|
|
|
'main/multiver.c',
|
|
|
|
'main/mprofile.c',
|
|
|
|
'main/netlist.c',
|
|
|
|
'main/netmisc.c',
|
|
|
|
'main/netpkt.c',
|
|
|
|
'main/network.c',
|
|
|
|
'main/newdemo.c',
|
|
|
|
'main/newmenu.c',
|
|
|
|
'main/nncoms.c',
|
|
|
|
'main/nocomlib.c',
|
|
|
|
'main/object.c',
|
|
|
|
'main/paging.c',
|
|
|
|
'main/physics.c',
|
|
|
|
'main/piggy.c',
|
|
|
|
'main/pingstat.c',
|
|
|
|
'main/playsave.c',
|
|
|
|
'main/polyobj.c',
|
|
|
|
'main/powerup.c',
|
|
|
|
'main/radar.c',
|
|
|
|
'main/reconfig.c',
|
|
|
|
'main/reorder.c',
|
|
|
|
'main/render.c',
|
|
|
|
'main/robot.c',
|
|
|
|
'main/scores.c',
|
|
|
|
'main/slew.c',
|
|
|
|
'main/songs.c',
|
|
|
|
'main/state.c',
|
|
|
|
'main/switch.c',
|
|
|
|
'main/terrain.c',
|
|
|
|
'main/texmerge.c',
|
|
|
|
'main/text.c',
|
|
|
|
'main/titles.c',
|
|
|
|
'main/vclip.c',
|
|
|
|
'main/vlcnfire.c',
|
|
|
|
'main/wall.c',
|
|
|
|
'main/weapon.c',
|
|
|
|
'mem/mem.c',
|
|
|
|
'misc/compare.c',
|
|
|
|
'misc/d_glob.c',
|
|
|
|
'misc/d_delay.c',
|
|
|
|
'misc/d_io.c',
|
|
|
|
'misc/d_slash.c',
|
|
|
|
'misc/error.c',
|
|
|
|
'misc/strio.c',
|
|
|
|
'misc/strutil.c',
|
|
|
|
'texmap/ntmap.c',
|
|
|
|
'texmap/scanline.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
# for editor
|
|
|
|
editor_sources = [
|
|
|
|
'editor/centers.c',
|
|
|
|
'editor/curves.c',
|
|
|
|
'editor/autosave.c',
|
|
|
|
'editor/eglobal.c',
|
|
|
|
'editor/ehostage.c',
|
|
|
|
'editor/elight.c',
|
|
|
|
'editor/eobject.c',
|
|
|
|
'editor/eswitch.c',
|
|
|
|
'editor/fixseg.c',
|
|
|
|
'editor/func.c',
|
|
|
|
'editor/group.c',
|
|
|
|
'editor/info.c',
|
|
|
|
'editor/kbuild.c',
|
|
|
|
'editor/kcurve.c',
|
|
|
|
'editor/kfuncs.c',
|
|
|
|
'editor/kgame.c',
|
|
|
|
'editor/khelp.c',
|
|
|
|
'editor/kmine.c',
|
|
|
|
'editor/ksegmove.c',
|
|
|
|
'editor/ksegsel.c',
|
|
|
|
'editor/ksegsize.c',
|
|
|
|
'editor/ktmap.c',
|
|
|
|
'editor/kview.c',
|
|
|
|
'editor/med.c',
|
|
|
|
'editor/meddraw.c',
|
|
|
|
'editor/medmisc.c',
|
|
|
|
'editor/medrobot.c',
|
|
|
|
'editor/medsel.c',
|
|
|
|
'editor/medwall.c',
|
|
|
|
'editor/mine.c',
|
|
|
|
'editor/objpage.c',
|
|
|
|
'editor/segment.c',
|
|
|
|
'editor/seguvs.c',
|
|
|
|
'editor/texpage.c',
|
|
|
|
'editor/texture.c',
|
|
|
|
'main/gamemine.c',
|
|
|
|
'main/gamesave.c',
|
|
|
|
'ui/button.c',
|
|
|
|
'ui/checkbox.c',
|
|
|
|
'ui/gadget.c',
|
|
|
|
'ui/icon.c',
|
|
|
|
'ui/inputbox.c',
|
|
|
|
'ui/keypad.c',
|
|
|
|
'ui/keypress.c',
|
|
|
|
'ui/keytrap.c',
|
|
|
|
'ui/lfile.c',
|
|
|
|
'ui/listbox.c',
|
|
|
|
'ui/menu.c',
|
|
|
|
'ui/menubar.c',
|
|
|
|
'ui/message.c',
|
|
|
|
'ui/mouse.c',
|
|
|
|
'ui/popup.c',
|
|
|
|
'ui/radio.c',
|
|
|
|
'ui/scroll.c',
|
|
|
|
'ui/ui.c',
|
|
|
|
'ui/uidraw.c',
|
|
|
|
'ui/userbox.c',
|
|
|
|
'ui/window.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
# for linux
|
|
|
|
arch_linux_sources = [
|
|
|
|
'arch/linux/arch_ip.cpp',
|
|
|
|
'arch/linux/init.c',
|
|
|
|
'arch/linux/ipx_bsd.c',
|
|
|
|
'arch/linux/ipx_kali.c',
|
|
|
|
'arch/linux/linuxnet.c',
|
|
|
|
'arch/linux/mono.c',
|
|
|
|
'arch/linux/serial.c',
|
|
|
|
'arch/linux/timer.c',
|
|
|
|
'arch/linux/ukali.c',
|
2007-01-12 16:31:25 +00:00
|
|
|
'arch/sdl/clipboard.c'
|
2006-07-27 09:46:44 +00:00
|
|
|
]
|
|
|
|
|
2006-10-18 17:08:59 +00:00
|
|
|
# choosing a sound implementation for Linux
|
|
|
|
common_sound_hmp2mid = [ 'main/hmp2mid.c' ]
|
2006-10-17 20:52:09 +00:00
|
|
|
arch_linux_sound_sdlmixer = [ 'arch/sdl/mixdigi.c', 'arch/sdl/mixmusic.c' ]
|
|
|
|
arch_linux_sound_old = [ 'arch/sdl/digi.c', 'arch/linux/hmiplay.c' ]
|
|
|
|
|
|
|
|
if (sdlmixer == 1):
|
2006-10-18 17:08:59 +00:00
|
|
|
common_sources += common_sound_hmp2mid
|
2006-10-17 20:52:09 +00:00
|
|
|
arch_linux_sources += arch_linux_sound_sdlmixer
|
|
|
|
else:
|
|
|
|
arch_linux_sources += arch_linux_sound_old
|
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
# for windows
|
|
|
|
arch_win32_sources = [
|
|
|
|
'arch/win32/arch_ip.cpp',
|
|
|
|
'arch/win32/hmpfile.c',
|
|
|
|
'arch/win32/init.c',
|
|
|
|
'arch/win32/ipx_win.c',
|
|
|
|
'arch/win32/midi.c',
|
|
|
|
'arch/win32/mono.c',
|
|
|
|
'arch/win32/serial.c',
|
|
|
|
'arch/win32/timer.c',
|
|
|
|
'arch/win32/winnet.c',
|
2007-01-12 16:31:25 +00:00
|
|
|
'arch/sdl/digi.c'
|
2006-07-27 09:46:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# for opengl
|
|
|
|
arch_ogl_sources = [
|
|
|
|
'arch/ogl/gr.c',
|
|
|
|
'arch/ogl/ogl.c',
|
2006-10-17 20:52:09 +00:00
|
|
|
'arch/ogl/sdlgl.c'
|
2006-07-27 09:46:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# for sdl
|
|
|
|
arch_sdl_sources = [
|
|
|
|
'arch/sdl/gr.c',
|
|
|
|
'texmap/tmapflat.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
# assembler related
|
|
|
|
asm_sources = [
|
|
|
|
'2d/linear.asm',
|
|
|
|
'2d/tmerge_a.asm',
|
|
|
|
'maths/fix.asm',
|
|
|
|
'maths/rand.c',
|
|
|
|
'maths/vecmat.c',
|
|
|
|
'maths/vecmata.asm',
|
|
|
|
'texmap/tmap_ll.asm',
|
|
|
|
'texmap/tmap_flt.asm',
|
|
|
|
'texmap/tmapfade.asm',
|
|
|
|
'texmap/tmap_lin.asm',
|
|
|
|
'texmap/tmap_per.asm'
|
|
|
|
]
|
|
|
|
|
|
|
|
noasm_sources = [
|
|
|
|
'maths/fixc.c',
|
|
|
|
'maths/rand.c',
|
|
|
|
'maths/tables.c',
|
|
|
|
'maths/vecmat.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
# flags and stuff for all platforms
|
|
|
|
env = Environment(ENV = os.environ)
|
2007-01-12 16:31:25 +00:00
|
|
|
env.ParseConfig('sdl-config --cflags')
|
|
|
|
env.ParseConfig('sdl-config --libs')
|
2007-01-12 16:34:30 +00:00
|
|
|
env.Append(CPPFLAGS = ['-Wall', '-funsigned-char'])
|
2006-07-27 09:46:44 +00:00
|
|
|
env.Append(CPPDEFINES = [('D1XMAJOR', '\\"' + str(D1XMAJOR) + '\\"'), ('D1XMINOR', '\\"' + str(D1XMINOR) + '\\"')])
|
2006-10-17 20:52:09 +00:00
|
|
|
#env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')])
|
|
|
|
env.Append(CPPDEFINES = [('USE_SDLMIXER', sdlmixer)])
|
2006-07-27 09:46:44 +00:00
|
|
|
env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', 'SUPPORTS_NET_IP', '__SDL__', 'SDL_INPUT', 'SDL_AUDIO', '_REENTRANT'])
|
2006-10-17 20:52:09 +00:00
|
|
|
env.Append(CPPPATH = ['include', 'main', 'arch/sdl/include'])
|
2007-01-12 16:31:25 +00:00
|
|
|
generic_libs = ['SDL']
|
|
|
|
sdlmixerlib = ['SDL_mixer']
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# windows or *nix?
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
print "compiling on Windows"
|
|
|
|
osdef = '__WINDOWS__'
|
2006-07-27 20:38:37 +00:00
|
|
|
osasmdef = 'win32'
|
2006-11-22 05:35:10 +00:00
|
|
|
sharepath = ''
|
2006-07-27 09:46:44 +00:00
|
|
|
env.Append(CPPDEFINES = ['__WINDOWS__'])
|
|
|
|
env.Append(CPPPATH = ['arch/win32/include'])
|
|
|
|
ogldefines = ['SDL_GL', 'OGL_RUNTIME_LOAD', 'OGL']
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += arch_win32_sources
|
|
|
|
ogllibs = ''
|
2006-07-27 14:03:41 +00:00
|
|
|
winlibs = ['glu32', 'wsock32', 'winmm', 'mingw32', 'SDLmain']
|
2007-01-12 16:37:59 +00:00
|
|
|
libs = winlibs + generic_libs
|
2006-07-27 09:46:44 +00:00
|
|
|
lflags = '-mwindows'
|
|
|
|
else:
|
|
|
|
print "compiling on *NIX"
|
|
|
|
osdef = '__LINUX__'
|
2006-07-27 20:38:37 +00:00
|
|
|
osasmdef = 'elf'
|
2007-01-22 10:38:03 +00:00
|
|
|
sharepath += '/'
|
2006-07-27 09:46:44 +00:00
|
|
|
env.Append(CPPDEFINES = ['__LINUX__', 'WANT_AWE32'])
|
|
|
|
env.Append(CPPPATH = ['arch/linux/include'])
|
|
|
|
ogldefines = ['SDL_GL', 'OGL']
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += arch_linux_sources
|
2006-07-27 09:46:44 +00:00
|
|
|
ogllibs = ['GL', 'GLU']
|
2007-01-12 16:31:25 +00:00
|
|
|
libs = generic_libs
|
|
|
|
lflags = ''
|
2006-07-27 09:46:44 +00:00
|
|
|
|
2006-11-22 05:35:10 +00:00
|
|
|
# GP2X test env
|
|
|
|
if (gp2x == 1):
|
|
|
|
sdl_only = 1
|
|
|
|
arm = 1
|
|
|
|
sharepath = ''
|
|
|
|
env.Replace(CC = '/usr/local/gp2xdev/bin/gp2x-gcc')
|
|
|
|
env.Replace(CXX = '/usr/local/gp2xdev/bin/gp2x-g++')
|
|
|
|
env.Append(CPPDEFINES = ['GP2X'])
|
|
|
|
env.Append(CPPPATH = ['/usr/local/gp2xdev/include'])
|
2006-11-28 08:56:24 +00:00
|
|
|
#env.Append(CPPFLAGS = ' -ffast-math -fPIC -funroll-all-loops -fomit-frame-pointer -march=armv4t') # left for further optimisation/debugging
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += ['main/clock.c']
|
|
|
|
libs += ['pthread']
|
2006-11-22 05:35:10 +00:00
|
|
|
lflags = '-static'
|
|
|
|
lpath = '/usr/local/gp2xdev/lib'
|
|
|
|
else:
|
|
|
|
lpath = ''
|
|
|
|
|
|
|
|
# arm architecture?
|
|
|
|
if (arm == 1):
|
|
|
|
no_asm = 1
|
|
|
|
env.Append(CPPDEFINES = ['WORDS_NEED_ALIGNMENT'])
|
2007-01-12 16:31:25 +00:00
|
|
|
env.Append(CPPFLAGS = ['-mstructure-size-boundary=8'])
|
2006-11-22 05:35:10 +00:00
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
# sdl or opengl?
|
|
|
|
if (sdl_only == 1):
|
|
|
|
print "building with SDL"
|
|
|
|
target = 'd1x-rebirth-sdl'
|
|
|
|
env.Append(CPPDEFINES = ['SDL_VIDEO'])
|
|
|
|
env.Append(CPPPATH = ['arch/sdl/include'])
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += arch_sdl_sources
|
2006-07-27 09:46:44 +00:00
|
|
|
else:
|
|
|
|
print "building with OpenGL"
|
|
|
|
target = 'd1x-rebirth-gl'
|
|
|
|
env.Append(CPPDEFINES = ogldefines)
|
|
|
|
env.Append(CPPPATH = ['arch/ogl/include'])
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += arch_ogl_sources
|
|
|
|
libs += ogllibs
|
2006-10-17 20:52:09 +00:00
|
|
|
|
|
|
|
# SDL_mixer for sound? (*NIX only)
|
|
|
|
if (sdlmixer == 1):
|
|
|
|
print "including SDL_mixer"
|
2007-01-12 16:31:25 +00:00
|
|
|
libs += sdlmixerlib
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# debug?
|
|
|
|
if (debug == 1):
|
|
|
|
print "including: DEBUG"
|
2007-01-12 16:31:25 +00:00
|
|
|
env.Append(CPPFLAGS = ['-g'])
|
2006-07-27 09:46:44 +00:00
|
|
|
else:
|
2006-07-28 19:23:59 +00:00
|
|
|
env.Append(CPPDEFINES = ['NDEBUG', 'RELEASE'])
|
2007-01-12 16:34:30 +00:00
|
|
|
env.Append(CPPFLAGS = ['-O2'])
|
2006-07-27 09:46:44 +00:00
|
|
|
|
2006-07-28 19:23:59 +00:00
|
|
|
# profiler?
|
|
|
|
if (profiler == 1):
|
2007-01-12 16:31:25 +00:00
|
|
|
env.Append(CPPFLAGS = ['-pg'])
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# assembler code?
|
|
|
|
if (no_asm == 0) and (sdl_only == 1):
|
|
|
|
print "including: ASSEMBLER"
|
|
|
|
env.Append(CPPDEFINES = ['ASM_VECMAT'])
|
|
|
|
Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ')
|
|
|
|
env.Replace(AS = 'nasm')
|
2006-07-27 20:38:37 +00:00
|
|
|
env.Append(ASCOM = ' -f ' + str(osasmdef) + ' -d' + str(osdef) + ' -Itexmap/ ')
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += asm_sources + ['texmap/tmappent.o', 'texmap/tmapppro.o']
|
2006-07-27 09:46:44 +00:00
|
|
|
else:
|
|
|
|
env.Append(CPPDEFINES = ['NO_ASM'])
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += noasm_sources
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
#editor build?
|
|
|
|
if (editor == 1):
|
|
|
|
env.Append(CPPDEFINES = ['EDITOR'])
|
|
|
|
env.Append(CPPPATH = ['include/editor'])
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += editor_sources
|
2006-10-06 00:12:16 +00:00
|
|
|
|
|
|
|
#shareware build?
|
|
|
|
if (shareware == 1):
|
|
|
|
env.Append(CPPDEFINES = ['SHAREWARE'])
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += ['main/gamesave.c', 'main/gamemine.c', 'main/snddecom.c']
|
2006-10-06 00:12:16 +00:00
|
|
|
|
|
|
|
if (shareware == 0) and (editor == 0):
|
2007-01-12 16:31:25 +00:00
|
|
|
common_sources += ['main/loadrl2.c']
|
2006-07-27 09:46:44 +00:00
|
|
|
|
2006-10-18 17:08:59 +00:00
|
|
|
print '\n'
|
|
|
|
|
2007-01-22 10:38:03 +00:00
|
|
|
env.Append(CPPDEFINES = [('DESCENT_DATA_PATH', '\\"' + str(sharepath) + '\\"')])
|
2006-07-27 09:46:44 +00:00
|
|
|
# finally building program...
|
2007-01-12 16:31:25 +00:00
|
|
|
env.Program(target=str(target), source = common_sources, LIBS = libs, LINKFLAGS = str(lflags), LIBPATH = str(lpath))
|
2006-10-17 20:52:09 +00:00
|
|
|
env.Install(BIN_DIR, str(target))
|
|
|
|
env.Alias('install', BIN_DIR)
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# show some help when running scons -h
|
2006-10-17 20:52:09 +00:00
|
|
|
Help(PROGRAM_NAME + ', SConstruct file help:' +
|
|
|
|
"""
|
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
Type 'scons' to build the binary.
|
2007-01-12 16:31:25 +00:00
|
|
|
Type 'scons install' to build (if it hasn't been done) and install.
|
2006-07-27 09:46:44 +00:00
|
|
|
Type 'scons -c' to clean up.
|
2006-10-17 20:52:09 +00:00
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
Extra options (add them to command line, like 'scons extraoption=value'):
|
2006-10-17 20:52:09 +00:00
|
|
|
|
|
|
|
'sharepath=DIR' (*NIX only) use DIR for shared game data. Must end with a slash.
|
|
|
|
'sdl_only=1' don't include OpenGL, use SDL-only instead
|
|
|
|
'sdlmixer=1' (*NIX only) use SDL_Mixer for sound (includes external music support)
|
|
|
|
'shareware=1' build SHAREWARE version
|
|
|
|
'no_asm=1' don't use ASSEMBLER (only with sdl_only=1)
|
|
|
|
'debug=1' build DEBUG binary which includes asserts, debugging output, cheats and more output
|
|
|
|
'profiler=1' do profiler build
|
|
|
|
'editor=1' build editor !EXPERIMENTAL!
|
2006-11-22 05:35:10 +00:00
|
|
|
'arm=1' compile for ARM architecture
|
|
|
|
'gp2x=1' compile for GP2X handheld
|
2006-10-17 20:52:09 +00:00
|
|
|
|
|
|
|
Default values:
|
|
|
|
""" + ' sharepath = ' + DATA_DIR + '\n')
|
|
|
|
|
|
|
|
#EOF
|