| 1 |
import os
|
| 2 |
|
| 3 |
Import('env') # inherit from parent
|
| 4 |
|
| 5 |
mlib = ['$RAD_MLIB']
|
| 6 |
progs = []
|
| 7 |
|
| 8 |
# compose paths
|
| 9 |
def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
|
| 10 |
def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
|
| 11 |
|
| 12 |
setscan = env.Object(source='setscan.c')
|
| 13 |
Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice
|
| 14 |
|
| 15 |
# standard targets
|
| 16 |
PROGS = [
|
| 17 |
('findglare', Split('findglare.c glareval.c glaresrc.c')+[setscan],
|
| 18 |
['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']),
|
| 19 |
#('contour', Split('contour.c'), ['rtmath']), # XXX what is this?
|
| 20 |
('glarendx', Split('glarendx.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 21 |
('vwright', Split('vwright.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 22 |
('vwrays', Split('vwrays.c'), ['rtpic','rtio','rtargs','rtmath']),
|
| 23 |
('rad', Split('rad.c'),
|
| 24 |
['rtpic','rtproc','rtpath','rtio','rtmath','rtargs','rtcont','rtmem','rterror']),
|
| 25 |
('rpiece', Split('rpiece.c') + [Version],
|
| 26 |
['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']),
|
| 27 |
]
|
| 28 |
if os.name == 'nt': # XXX should be set in a *.cfg file
|
| 29 |
netproc = 'win_netproc.c'
|
| 30 |
netlib = ['ws2_32']
|
| 31 |
else:
|
| 32 |
netproc = 'netproc.c'
|
| 33 |
netlib = []
|
| 34 |
|
| 35 |
PROGS.append(('ranimate', ['ranimate.c', netproc],
|
| 36 |
['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath','rtnet','rterror'] + netlib))
|
| 37 |
for p in PROGS:
|
| 38 |
prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
|
| 39 |
progs.append(prog)
|
| 40 |
|
| 41 |
if os.name != 'nt': # XXX pending Windows version of raypcalls.c
|
| 42 |
# targets with different includes/libs
|
| 43 |
rs = Split('ranimove.c ranimove1.c ranimove2.c')
|
| 44 |
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 |
progs.append(ranimove)
|
| 49 |
|
| 50 |
getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
|
| 51 |
LIBS=['rtio'])
|
| 52 |
progs.append(getinfo)
|
| 53 |
|
| 54 |
|
| 55 |
# X11 targets
|
| 56 |
if env.has_key('X11LIB'):
|
| 57 |
xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
|
| 58 |
xlibp = env.get('LIBPATH', []) + ['$X11LIB']
|
| 59 |
x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice
|
| 60 |
CPPPATH=xincl)
|
| 61 |
xglaresrc = env.Program(target=radbin('xglaresrc'),
|
| 62 |
source=Split('xglaresrc.c') + [x11findwind],
|
| 63 |
LIBPATH=xlibp, CPPPATH=xincl,
|
| 64 |
LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
|
| 65 |
progs.append(xglaresrc)
|
| 66 |
|
| 67 |
# OpenGL targets that also depend on X11
|
| 68 |
if env.has_key('OGL'):
|
| 69 |
glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
|
| 70 |
CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'],
|
| 71 |
LIBPATH=xlibp, CPPPATH=xincl,
|
| 72 |
LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs',
|
| 73 |
'rtmath','rtcont','rtmem','rterror',
|
| 74 |
'GL', 'GLU','X11'],)
|
| 75 |
progs.append(glrad)
|
| 76 |
|
| 77 |
if os.name == 'posix': # XXX ignoring trad.wsh
|
| 78 |
for s in Split('''objview objline objpict
|
| 79 |
glare dayfact debugcal rlux raddepend compamb vinfo genambpos'''):
|
| 80 |
Default(env.InstallCsh(radbin(s), s + '.csh'))
|
| 81 |
# Those don't really work yet
|
| 82 |
#else:
|
| 83 |
# for s in Split('''objview glare rlux '''):
|
| 84 |
# prog = env.Program(target=radbin(s), source=s+'.c')
|
| 85 |
# progs.append(prog)
|
| 86 |
|
| 87 |
Default('#src/util')
|
| 88 |
env.Install('$RAD_BINDIR', progs)
|
| 89 |
|