import os Import('env') # inherit from parent mlib = ['$RAD_MLIB'] progs = [] # compose paths def radbin(name): return os.path.join('$RAD_BUILDBIN', name) def radlib(name): return os.path.join('$RAD_BUILDLIB', name) Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice # standard targets PROGS = [ ('findglare', Split('findglare.c glareval.c glaresrc.c setscan.c'), ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']), ('glarendx', Split('glarendx.c'), ['rtpic','rtio','rtargs','rtmath']), ('vwright', Split('vwright.c'), ['rtpic','rtio','rtargs','rtmath']), ('vwrays', Split('vwrays.c'), ['rtpic','rtio','rtargs','rtmath']), ('rad', Split('rad.c'), ['rtpic','rtproc','rtpath','rtio','rtmath','rtargs','rtcont','rtmem','rterror']), ('rpiece', Split('rpiece.c') + [Version], ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']), ] if os.name == 'nt': # XXX should be set in a *.cfg file netproc = 'win_netproc.c' netlib = ['ws2_32'] else: netproc = 'netproc.c' netlib = [] PROGS.append(('ranimate', ['ranimate.c', netproc], ['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath','rtnet','rterror'] + netlib)) for p in PROGS: prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib) progs.append(prog) if os.name != 'nt': # XXX pending Windows version of raypcalls.c # targets with different includes/libs rs = Split('ranimove.c ranimove1.c ranimove2.c') ranimove = env.Program(target=radbin('ranimove'), source=rs, CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'], LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtio', 'rtmath','rtcont','rtmem','rtargs','rtproc','rtpath','rterror'] + mlib) progs.append(ranimove) getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c', LIBS=['rtio']) progs.append(getinfo) # X11 targets if env.has_key('X11LIB'): xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] xlibp = env.get('LIBPATH', []) + ['$X11LIB'] x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice CPPPATH=xincl) xglaresrc = env.Program(target=radbin('xglaresrc'), source=Split('xglaresrc.c') + [x11findwind], LIBPATH=xlibp, CPPPATH=xincl, LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib) progs.append(xglaresrc) # OpenGL targets that also depend on X11 if env.has_key('OGL'): glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'), CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'], LIBPATH=xlibp, CPPPATH=xincl, LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs', 'rtmath','rtcont','rtmem','rterror', 'GL', 'GLU','X11'],) progs.append(glrad) if os.name == 'posix': # XXX ignoring trad.wsh for s in Split('''objview objline objpict glare dayfact debugcal rlux raddepend compamb vinfo genambpos'''): Default(env.InstallCsh(radbin(s), s + '.csh')) # Those don't really work yet #else: # for s in Split('''objview glare rlux '''): # prog = env.Program(target=radbin(s), source=s+'.c') # progs.append(prog) Default('#src/util') env.Install('$RAD_BINDIR', progs)