2006-07-27 09:46:44 +00:00
|
|
|
#SConstruct
|
|
|
|
|
|
|
|
# needed imports
|
|
|
|
import sys
|
|
|
|
import os
|
2007-05-30 14:29:40 +00:00
|
|
|
import SCons.Util
|
2006-07-27 09:46:44 +00:00
|
|
|
|
2006-10-17 20:52:09 +00:00
|
|
|
PROGRAM_NAME = 'D1X-Rebirth'
|
|
|
|
|
2007-10-12 20:09:26 +00:00
|
|
|
# version number
|
2006-07-27 09:46:44 +00:00
|
|
|
D1XMAJOR = 0
|
2007-10-22 12:07:02 +00:00
|
|
|
D1XMINOR = 53
|
2007-02-14 21:02:46 +00:00
|
|
|
|
2006-10-17 20:52:09 +00:00
|
|
|
# installation path
|
|
|
|
PREFIX = '/usr/local/'
|
2007-04-05 14:48:37 +00:00
|
|
|
BIN_SUBDIR = 'bin/'
|
2006-10-17 20:52:09 +00:00
|
|
|
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))
|
2007-08-28 00:01:25 +00:00
|
|
|
asm = int(ARGUMENTS.get('asm', 0))
|
2006-07-27 09:46:44 +00:00
|
|
|
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))
|
2007-10-12 20:09:26 +00:00
|
|
|
micro = int(ARGUMENTS.get('micro', 0))
|
|
|
|
|
|
|
|
if (micro > 0):
|
|
|
|
D1XMICRO = micro
|
|
|
|
else:
|
|
|
|
D1XMICRO = 0
|
|
|
|
|
|
|
|
VERSION_STRING = ' v' + str(D1XMAJOR) + '.' + str(D1XMINOR)
|
|
|
|
if (D1XMICRO):
|
|
|
|
VERSION_STRING += '.' + str(D1XMICRO)
|
|
|
|
|
|
|
|
print '\n===== ' + PROGRAM_NAME + VERSION_STRING + ' =====\n'
|
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/joy.c',
|
|
|
|
'arch/sdl/joydefs.c',
|
|
|
|
'arch/sdl/key.c',
|
|
|
|
'arch/sdl/mouse.c',
|
2007-03-25 21:00:14 +00:00
|
|
|
'arch/sdl/timer.c',
|
2007-09-18 13:37:39 +00:00
|
|
|
'arch/sdl/digi.c',
|
|
|
|
'arch/sdl/digi_audio.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/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/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/morph.c',
|
|
|
|
'main/multi.c',
|
|
|
|
'main/multibot.c',
|
|
|
|
'main/multipow.c',
|
|
|
|
'main/multiver.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/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_io.c',
|
|
|
|
'misc/d_slash.c',
|
2007-03-12 21:56:41 +00:00
|
|
|
'misc/dl_list.c',
|
2006-07-27 09:46:44 +00:00
|
|
|
'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/ipx_bsd.c',
|
|
|
|
'arch/linux/ipx_kali.c',
|
|
|
|
'arch/linux/linuxnet.c',
|
|
|
|
'arch/linux/mono.c',
|
2007-09-30 13:38:25 +00:00
|
|
|
'arch/linux/ukali.c'
|
2007-09-18 13:37:39 +00:00
|
|
|
]
|
2006-10-17 20:52:09 +00:00
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
# for windows
|
|
|
|
arch_win32_sources = [
|
|
|
|
'arch/win32/arch_ip.cpp',
|
|
|
|
'arch/win32/hmpfile.c',
|
|
|
|
'arch/win32/ipx_win.c',
|
|
|
|
'arch/win32/mono.c',
|
|
|
|
'arch/win32/winnet.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
# 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'
|
|
|
|
]
|
|
|
|
|
2007-09-18 13:37:39 +00:00
|
|
|
# SDL_mixer sound implementation
|
|
|
|
arch_sdlmixer = [
|
|
|
|
'misc/hmp2mid.c',
|
|
|
|
'arch/sdl/digi_mixer.c',
|
|
|
|
'arch/sdl/digi_mixer_music.c',
|
|
|
|
'arch/sdl/jukebox.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
if (sdlmixer == 1):
|
|
|
|
arch_linux_sources += arch_sdlmixer
|
|
|
|
|
|
|
|
|
2006-07-27 09:46:44 +00:00
|
|
|
# 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) + '\\"')])
|
2007-07-18 20:13:17 +00:00
|
|
|
env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', '__SDL__', '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
|
|
|
|
2007-03-18 18:17:49 +00:00
|
|
|
if sdlmixer:
|
|
|
|
env.Append(CPPDEFINES = ['USE_SDLMIXER'])
|
|
|
|
|
2007-02-14 21:02:46 +00:00
|
|
|
if (D1XMICRO):
|
|
|
|
env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')])
|
|
|
|
|
2007-05-30 14:29:40 +00:00
|
|
|
# Get traditional compiler environment variables
|
|
|
|
if os.environ.has_key('CC'):
|
|
|
|
env['CC'] = os.environ['CC']
|
|
|
|
if os.environ.has_key('CFLAGS'):
|
|
|
|
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
|
|
|
|
if os.environ.has_key('CXX'):
|
|
|
|
env['CXX'] = os.environ['CXX']
|
|
|
|
if os.environ.has_key('CXXFLAGS'):
|
|
|
|
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
|
|
|
|
if os.environ.has_key('LDFLAGS'):
|
|
|
|
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
|
2007-02-14 21:02:46 +00:00
|
|
|
|
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'])
|
2007-07-18 20:13:17 +00:00
|
|
|
ogldefines = ['SDL_GL', '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 += '/'
|
2007-03-04 15:01:17 +00:00
|
|
|
env.Append(CPPDEFINES = ['__LINUX__'])
|
2006-07-27 09:46:44 +00:00
|
|
|
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
|
2007-02-09 15:50:50 +00:00
|
|
|
lflags = '-L/usr/X11R6/lib'
|
2006-07-27 09:46:44 +00:00
|
|
|
|
2006-11-22 05:35:10 +00:00
|
|
|
# arm architecture?
|
|
|
|
if (arm == 1):
|
2007-08-28 00:01:25 +00:00
|
|
|
asm = 0
|
2006-11-22 05:35:10 +00:00
|
|
|
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'])
|
2007-03-22 11:32:22 +00:00
|
|
|
lflags += ' -pg'
|
2006-07-27 09:46:44 +00:00
|
|
|
|
|
|
|
# assembler code?
|
2007-08-28 00:01:25 +00:00
|
|
|
if (asm == 1) and (sdl_only == 1):
|
2006-07-27 09:46:44 +00:00
|
|
|
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-06-11 15:54:09 +00:00
|
|
|
common_sources += ['main/snddecom.c']
|
|
|
|
if (editor == 0):
|
|
|
|
common_sources += ['main/gamesave.c', 'main/gamemine.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-09-28 22:44:04 +00:00
|
|
|
env.Program(target=str(target), source = common_sources, LIBS = libs, LINKFLAGS = str(lflags))
|
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
|
|
|
|
2007-04-06 19:54:31 +00:00
|
|
|
'sharepath=DIR' (*NIX only) use DIR for shared game data. (default: /usr/local/share/games/d1x-rebirth)
|
|
|
|
'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
|
2007-08-28 00:01:25 +00:00
|
|
|
'asm=1' use ASSEMBLER code (only with sdl_only=1, requires NASM and x86)
|
2007-04-06 19:54:31 +00:00
|
|
|
'debug=1' build DEBUG binary which includes asserts, debugging output, cheats and more output
|
|
|
|
'profiler=1' do profiler build
|
|
|
|
'editor=1' build editor !EXPERIMENTAL!
|
|
|
|
'arm=1' compile for ARM architecture
|
2006-10-17 20:52:09 +00:00
|
|
|
|
|
|
|
Default values:
|
2007-05-30 14:29:40 +00:00
|
|
|
""" + ' sharepath = ' + DATA_DIR + """
|
|
|
|
|
|
|
|
Some influential environment variables:
|
|
|
|
CC C compiler command
|
|
|
|
CFLAGS C compiler flags
|
|
|
|
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
|
|
|
|
nonstandard directory <lib dir>
|
|
|
|
<include dir>
|
|
|
|
CXX C++ compiler command
|
|
|
|
CXXFLAGS C++ compiler flags
|
|
|
|
""")
|
2006-10-17 20:52:09 +00:00
|
|
|
|
|
|
|
#EOF
|