ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/SConscript
Revision: 1.15
Committed: Sat Mar 5 00:29:28 2016 UTC (8 years, 2 months ago) by schorsch
Branch: MAIN
Changes since 1.14: +18 -5 lines
Log Message:
update SCons

File Contents

# User Rev Content
1 schorsch 1.1 import os
2 schorsch 1.5 from build_utils import vstamp
3 schorsch 1.1
4     Import('env') # inherit from parent
5    
6 schorsch 1.2 mlib = env['RAD_MLIB']
7 schorsch 1.1
8     # compose paths
9 schorsch 1.2 def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name)
10     def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name)
11 schorsch 1.1
12     # custom compile flags
13 schorsch 1.2 dielectric = env.Object(source='dielectric.c',
14     CCFLAGS=env.get('CCFLAGS',[]) + ['-DDISPERSE'])
15    
16     duphead = env.Object(source="duphead.c")
17     persist = env.Object(source="persist.c")
18     ambio = env.Object(source="ambio.c")
19 greg 1.12 rayfifo = env.Object(source="rayfifo.c")
20     raypwin = env.Object(source="raypwin.c")
21 greg 1.13 raycalls = env.Object(source="raycalls.c")
22 schorsch 1.2
23 schorsch 1.1
24     # source and object dependencies
25 schorsch 1.2 RAY = Split('''ambcomp.c ambient.c freeobjmem.c initotypes.c preload.c
26 schorsch 1.5 raytrace.c renderopts.c''') + [ambio]
27 schorsch 1.15 PMAP = Split('''pmap.c pmapsrc.c pmapmat.c pmaprand.c pmapio.c pmapdata.c
28     pmapbias.c pmapparm.c pmapcontrib.c pmapamb.c pmapray.c pmapopt.c
29     pmapdiag.c pmaptype.c''')
30 schorsch 1.1
31 schorsch 1.3 SURF = Split('''srcsamp.c srcsupp.c srcobstr.c source.c virtuals.c sphere.c
32     o_face.c o_cone.c o_instance.c o_mesh.c''')
33 schorsch 1.1
34     MAT = Split('''aniso.c normal.c m_clip.c glass.c m_brdf.c m_mirror.c
35 schorsch 1.15 m_direct.c m_mist.c fprism.c m_alias.c m_bsdf.c ashikhmin.c '''
36     ) + [dielectric]
37 schorsch 1.1
38     MOD = Split('p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c')
39    
40     SUP = Split('func.c noise3.c data.c')
41    
42     # build libraries
43 schorsch 1.15 rsrc = RAY + PMAP + SURF + MAT + MOD + SUP
44 schorsch 1.5 env.Command('Version.c', 'VERSION', vstamp.build_version_c)
45     env.Depends('Version.c', rsrc)
46 schorsch 1.6 Version = env.Object(source=['Version.c'])
47 schorsch 1.5 rlib = env.Library(target=radlib('rttrace'), source=rsrc + [Version])
48 schorsch 1.1
49 schorsch 1.10 #if os.name == 'nt': # XXX until we get around fork() and friends
50     # rcsrc = Split('raycalls.c')
51     #else: rcsrc = Split('raycalls.c raypcalls.c')
52     rcsrc = Split('raycalls.c $RAD_PCALLS')
53 schorsch 1.2 rclib = env.Library(target=radlib('raycalls'), source=rcsrc)
54 schorsch 1.1 Default(rclib)
55    
56 schorsch 1.10 fullib=['rttrace', 'rtscene', 'rtpic', 'rtfunc', 'rtproc', 'rtmath',
57     'rtargs', 'rtpath', 'rtio', 'rtcont', 'rtmem', 'rterror']
58 schorsch 1.1 # build executables
59 schorsch 1.2 lasrc = ['lookamb.c', ambio]
60     lookamb = env.Program(target=radbin('lookamb'), source=lasrc,
61 schorsch 1.15 LIBS=['rtio', 'rtpic', 'rtmath', mlib])
62 schorsch 1.1 Default(lookamb)
63 schorsch 1.6 env.Append(RAD_BININSTALL=[env.Install('$RAD_BINDIR', lookamb)])
64 schorsch 1.1
65 schorsch 1.15 rcontrib = env.Program(target=radbin('rcontrib'),
66     source = Split('rcmain.c rcontrib.c rc2.c rc3.c') + [Version],
67     LIBS= ['rttrace','rtscene','rtpic','rtargs','rtfunc','rtio',
68     'rtproc','rtcont',
69     'rtmem', 'rtpath', 'rtmath','rtnet','rterror','$RAD_SOCKETLIB',mlib]),
70     Default(rcontrib)
71     env.Append(RAD_BININSTALL=[env.Install('$RAD_BINDIR', rcontrib)])
72    
73    
74 schorsch 1.2 rtmain = env.Object(source=['rtmain.c'],
75     CCFLAGS=env.get('CCFLAGS',[]) + ['-DNICE=4'])
76 greg 1.12 rtsrc = ['rtrace.c', duphead, persist, rtmain, rayfifo, raypwin, raycalls]
77 schorsch 1.2 rtrace = env.Program(target=radbin('rtrace'), source=rtsrc,
78 schorsch 1.15 LIBS=fullib + ['rtnet'] + mlib
79 schorsch 1.6 )
80 schorsch 1.2 Default(rtrace)
81 schorsch 1.6 env.Append(RAD_BININSTALL=[env.Install('$RAD_BINDIR', rtrace)])
82 schorsch 1.2
83     rpsrc = Split('rpmain.c rpict.c srcdraw.c') + [duphead, persist]
84     rpict = env.Program(target=radbin('rpict'), source=rpsrc,
85 schorsch 1.8 LIBS=fullib+['rtnet','$RAD_SOCKETLIB']+mlib)
86 schorsch 1.2 Default(rpict)
87 schorsch 1.6 env.Append(RAD_BININSTALL=[env.Install('$RAD_BINDIR', rpict)])
88 schorsch 1.2
89 schorsch 1.4 if env.has_key('X11LIB'): # lots of special requirements for rvu
90 schorsch 1.2 x11incls = [env['X11INCLUDE']] + env['CPPPATH']
91     x11 = env.Object(source='x11.c', CPPPATH=x11incls)
92     x11twind = env.Object(source='x11twind.c', CPPPATH=x11incls)
93     rvmain = env.Object(source='rvmain.c',
94     CCFLAGS=env['CCFLAGS'] + ['-DNICE=6'])
95 schorsch 1.9 rv3 = env.Object(source='rv3.c',
96     CCFLAGS=env['CCFLAGS']
97 schorsch 1.6 )
98 schorsch 1.1
99     devsrc = Split('devtable.c devcomm.c colortab.c editline.c')
100     rvobjs = [x11, x11twind, rv3, rvmain, rlib]
101     rvsrc = Split('rview.c rv2.c') + devsrc + rvobjs
102 schorsch 1.4 rvu = env.Program(target=radbin('rvu'), source=rvsrc,
103 schorsch 1.2 LIBPATH=env['LIBPATH'] + [env['X11LIB']],
104 schorsch 1.15 LIBS = (['rtscene', rclib, 'rttrace', 'rtnet', 'rtpic', 'rtfunc', 'rtproc', 'rtmath',
105 schorsch 1.11 'rtargs', 'rtpath', 'rtio', 'rtcont', 'rtmem', 'rterror',
106     'X11'] + mlib)
107     #LIBS=fullib + ['X11', rclib] + mlib
108     )
109 schorsch 1.4 Default(rvu)
110 schorsch 1.6 env.Append(RAD_BININSTALL=[env.Install('$RAD_BINDIR', rvu)])
111 schorsch 1.1
112     LIBFILES = Split('rayinit.cal')
113 schorsch 1.6 env.Append(RAD_RLIBINSTALL=[env.Install('$RAD_RLIBDIR', LIBFILES)])
114 schorsch 1.1