| 1 |
schorsch |
1.1 |
import os
|
| 2 |
|
|
|
| 3 |
|
|
Import('env') # inherit from parent
|
| 4 |
|
|
|
| 5 |
schorsch |
1.2 |
mlib = env['RAD_MLIB']
|
| 6 |
schorsch |
1.1 |
|
| 7 |
|
|
# compose paths
|
| 8 |
|
|
def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name)
|
| 9 |
|
|
def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name)
|
| 10 |
|
|
|
| 11 |
schorsch |
1.2 |
setscan = env.Object(source='setscan.c')
|
| 12 |
schorsch |
1.5 |
Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice
|
| 13 |
schorsch |
1.2 |
|
| 14 |
schorsch |
1.1 |
# standard targets
|
| 15 |
|
|
PROGS = [
|
| 16 |
schorsch |
1.2 |
('findglare', Split('findglare.c glareval.c glaresrc.c')+[setscan],
|
| 17 |
|
|
['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']),
|
| 18 |
schorsch |
1.3 |
#('contour', Split('contour.c'), ['rtmath']), # XXX what is this?
|
| 19 |
schorsch |
1.2 |
('glarendx', Split('glarendx.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 20 |
|
|
('vwright', Split('vwright.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 21 |
|
|
('vwrays', Split('vwrays.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 22 |
|
|
('rad', Split('rad.c'),
|
| 23 |
|
|
['rtpic','rtproc','rtpath','rtio','rtmath','rtargs','rtcont','rtmem','rterror']),
|
| 24 |
schorsch |
1.5 |
('rpiece', Split('rpiece.c') + [Version],
|
| 25 |
schorsch |
1.2 |
['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']),
|
| 26 |
schorsch |
1.1 |
]
|
| 27 |
schorsch |
1.2 |
if os.name == 'nt': # XXX should be set in a *.cfg file
|
| 28 |
|
|
netproc = 'win_netproc.c'
|
| 29 |
|
|
netlib = ['ws2_32']
|
| 30 |
|
|
else:
|
| 31 |
|
|
netproc = 'netproc.c'
|
| 32 |
|
|
netlib = []
|
| 33 |
|
|
|
| 34 |
|
|
PROGS.append(('ranimate', ['ranimate.c', netproc],
|
| 35 |
|
|
['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath','rtnet','rterror'] + netlib))
|
| 36 |
schorsch |
1.1 |
for p in PROGS:
|
| 37 |
schorsch |
1.2 |
prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
|
| 38 |
|
|
Default(prog)
|
| 39 |
|
|
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
|
| 40 |
schorsch |
1.1 |
|
| 41 |
schorsch |
1.2 |
if os.name != 'nt': # XXX pending Windows version of raypcalls.c
|
| 42 |
schorsch |
1.1 |
# targets with different includes/libs
|
| 43 |
|
|
rs = Split('ranimove.c ranimove1.c ranimove2.c')
|
| 44 |
schorsch |
1.2 |
ranimove = env.Program(target=radbin('ranimove'), source=rs,
|
| 45 |
|
|
CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
|
| 46 |
|
|
LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtio',
|
| 47 |
|
|
'rtmath','rtcont','rtmem','rtargs','rtproc','rtpath','rterror'] + mlib)
|
| 48 |
schorsch |
1.1 |
Default(ranimove)
|
| 49 |
schorsch |
1.2 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ranimove)])
|
| 50 |
schorsch |
1.1 |
|
| 51 |
schorsch |
1.2 |
getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
|
| 52 |
|
|
LIBS=['rtio'])
|
| 53 |
schorsch |
1.1 |
Default(getinfo)
|
| 54 |
schorsch |
1.2 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], getinfo)])
|
| 55 |
schorsch |
1.1 |
|
| 56 |
|
|
# special targets not normally built
|
| 57 |
schorsch |
1.2 |
if os.name != 'nt': # XXX pending replacement of fork() and friends
|
| 58 |
|
|
scanner = env.Program(target=radbin('scanner'), source='scanner.c',
|
| 59 |
|
|
LIBS=mlib)
|
| 60 |
|
|
scanner_i = env.Install(env['RAD_BINDIR'], scanner)
|
| 61 |
|
|
makedist = env.Program(target=radbin('makedist'),
|
| 62 |
schorsch |
1.4 |
source=Split('makedist.c')+[setscan],
|
| 63 |
|
|
LIBS=['rtmath']+mlib)
|
| 64 |
schorsch |
1.2 |
makedist_i = env.Install(env['RAD_BINDIR'], makedist)
|
| 65 |
|
|
env.Alias('util_special', [scanner, makedist])
|
| 66 |
|
|
env.Alias('util_special_install', [scanner_i, makedist_i])
|
| 67 |
schorsch |
1.1 |
|
| 68 |
|
|
# X11 targets
|
| 69 |
schorsch |
1.2 |
if env.has_key('X11LIB'):
|
| 70 |
|
|
xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
|
| 71 |
|
|
xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
|
| 72 |
schorsch |
1.6 |
x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice
|
| 73 |
|
|
CPPPATH=xincl)
|
| 74 |
schorsch |
1.2 |
xglaresrc = env.Program(target=radbin('xglaresrc'),
|
| 75 |
schorsch |
1.5 |
source=Split('xglaresrc.c') + [x11findwind],
|
| 76 |
schorsch |
1.2 |
LIBPATH=xlibp, CPPPATH=xincl,
|
| 77 |
|
|
LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
|
| 78 |
|
|
Default(xglaresrc)
|
| 79 |
|
|
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xglaresrc)])
|
| 80 |
|
|
|
| 81 |
|
|
# OpenGL targets that also depend on X11
|
| 82 |
|
|
if env.has_key('OGL'):
|
| 83 |
|
|
glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
|
| 84 |
|
|
CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
|
| 85 |
|
|
LIBPATH=xlibp, CPPPATH=xincl,
|
| 86 |
|
|
LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs',
|
| 87 |
|
|
'rtmath','rtcont','rtmem','rterror',
|
| 88 |
|
|
'GL', 'GLU','X11'],)
|
| 89 |
|
|
Default(glrad)
|
| 90 |
|
|
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glrad)])
|
| 91 |
schorsch |
1.1 |
|
| 92 |
|
|
|