ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.21
Committed: Thu Mar 10 21:43:23 2016 UTC (8 years, 1 month ago) by schorsch
Branch: MAIN
Changes since 1.20: +20 -31 lines
Log Message:
reduce the number of libraries created

File Contents

# User Rev Content
1 schorsch 1.1 import os
2    
3     Import('env') # inherit from parent
4    
5 schorsch 1.7 mlib = ['$RAD_MLIB']
6     progs = []
7 schorsch 1.1
8     # compose paths
9 schorsch 1.7 def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
10     def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
11 schorsch 1.20 def tclscr(name): return os.path.join('$RAD_BUILDRLIB', 'tcl', name)
12 schorsch 1.1
13 schorsch 1.20 cmatrix = env.Object(source='cmatrix.c')
14     cmbsdf = env.Object(source='cmbsdf.c')
15 schorsch 1.2
16 schorsch 1.1 # standard targets
17     PROGS = [
18 schorsch 1.21 ('findglare', Split('findglare.c glareval.c glaresrc.c setscan.c'), ['rtrad']),
19     ('glarendx', Split('glarendx.c'), ['rtrad']),
20     ('vwright', Split('vwright.c'), ['rtrad']),
21     ('vwrays', Split('vwrays.c'), ['rtrad']),
22     ('rad', Split('rad.c'), ['rtrad']),
23     ('rpiece', Split('rpiece.c') + [env.version], ['rtrad']),
24     ('ranimate', ['ranimate.c', '$RAD_NETCOMPAT'], ['rtrad', '$RAD_SOCKETLIB']),
25     ('dctimestep', Split('dctimestep.c')+[cmatrix, cmbsdf], ['rtrad']),
26     ('rttree_reduce', Split('rttree_reduce.c'), ['rtrad']),
27     ('rcollate', Split('rcollate.c'), ['rtrad']),
28     ('eplus_adduvf', Split('eplus_adduvf.c eplus_idf.c'), ['rtrad']),
29     ('rfluxmtx', Split('rfluxmtx.c'), ['rtrad']),
30     ('rmtxop', Split('rmtxop.c rmatrix.c')+[cmatrix, cmbsdf], ['rtrad']),
31     ('wrapBSDF', Split('wrapBSDF.c'), ['rtrad']),
32     ('evalglare', Split('evalglare.c pictool.c'), ['rtrad', 'reetz']),
33 schorsch 1.1 ]
34 schorsch 1.12
35 schorsch 1.1 for p in PROGS:
36 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
37 schorsch 1.7 progs.append(prog)
38 schorsch 1.1
39 schorsch 1.20 # targets with different includes/libs
40     rs = Split('ranimove.c ranimove1.c ranimove2.c')
41     ranimove = env.Program(target=radbin('ranimove'), source=rs,
42     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
43 schorsch 1.21 LIBS=['raycalls','rttrace','rtrad'] + mlib)
44 schorsch 1.20 progs.append(ranimove)
45     rsensor = env.Program(target=radbin('rsensor'), source='rsensor.c',
46     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
47 schorsch 1.21 LIBS=['raycalls','rttrace','rtrad'] + mlib)
48 schorsch 1.20 progs.append(rsensor)
49 schorsch 1.1
50 schorsch 1.2 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
51 schorsch 1.21 LIBS=['rtrad'])
52 schorsch 1.7 progs.append(getinfo)
53 schorsch 1.1
54    
55     # X11 targets
56 schorsch 1.2 if env.has_key('X11LIB'):
57 schorsch 1.7 xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
58     xlibp = env.get('LIBPATH', []) + ['$X11LIB']
59 schorsch 1.2 xglaresrc = env.Program(target=radbin('xglaresrc'),
60 schorsch 1.16 source=Split('xglaresrc.c') + [env.x11findwind], # XXX remote magic
61 schorsch 1.2 LIBPATH=xlibp, CPPPATH=xincl,
62 schorsch 1.21 LIBS=['rtrad', 'X11']+ mlib)
63 schorsch 1.7 progs.append(xglaresrc)
64 schorsch 1.2
65     # OpenGL targets that also depend on X11
66     if env.has_key('OGL'):
67     glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
68 schorsch 1.7 CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'],
69 schorsch 1.2 LIBPATH=xlibp, CPPPATH=xincl,
70 schorsch 1.21 LIBS=['rgl','rtrad','rtdummy', 'GL', 'GLU','X11'] + mlib,)
71 schorsch 1.7 progs.append(glrad)
72 schorsch 1.1
73 schorsch 1.7 if os.name == 'posix': # XXX ignoring trad.wsh
74 schorsch 1.20 for s in Split('''objline glare dayfact
75     debugcal rlux raddepend compamb vinfo fieldcomb'''):
76 schorsch 1.19 Default(env.InstallScript(radbin(s), s + '.csh'))
77 schorsch 1.20 for s in Split('''objview objpict
78     genambpos genklemsamp genskyvec genBSDF ltview ltpict'''):
79     Default(env.InstallScript(radbin(s), s + '.pl'))
80     for s in Split('''do_action.tcl do_file.tcl do_options.tcl do_results.tcl
81     do_scene.tcl do_views.tcl do_zone.tcl file.hlp getfile.tcl gethelp.tcl
82     help.hlp tclIndex trad.hlp trad.icon util.tcl'''):
83     Default(env.InstallScript(tclscr(s), s))
84     Default(env.InstallTCLScript(radbin('trad'), 'trad.wsh'))
85    
86 schorsch 1.8 # Those don't really work yet
87     #else:
88     # for s in Split('''objview glare rlux '''):
89     # prog = env.Program(target=radbin(s), source=s+'.c')
90     # progs.append(prog)
91 schorsch 1.7
92     Default('#src/util')
93     env.Install('$RAD_BINDIR', progs)
94 schorsch 1.1
95 schorsch 1.20 # vim: set syntax=python: