| 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.1 |  | 
| 12 | schorsch | 1.2 | setscan = env.Object(source='setscan.c') | 
| 13 | schorsch | 1.5 | Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice | 
| 14 | schorsch | 1.2 |  | 
| 15 | schorsch | 1.1 | # standard targets | 
| 16 |  |  | PROGS = [ | 
| 17 | schorsch | 1.2 | ('findglare', Split('findglare.c glareval.c glaresrc.c')+[setscan], | 
| 18 |  |  | ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']), | 
| 19 | schorsch | 1.3 | #('contour',   Split('contour.c'),  ['rtmath']), # XXX what is this? | 
| 20 | schorsch | 1.2 | ('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 | schorsch | 1.5 | ('rpiece',    Split('rpiece.c') + [Version], | 
| 26 | schorsch | 1.2 | ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']), | 
| 27 | schorsch | 1.1 | ] | 
| 28 | schorsch | 1.2 | 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 | schorsch | 1.1 | for p in PROGS: | 
| 38 | schorsch | 1.2 | prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib) | 
| 39 | schorsch | 1.7 | progs.append(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.7 | progs.append(ranimove) | 
| 49 | schorsch | 1.1 |  | 
| 50 | schorsch | 1.2 | getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c', | 
| 51 |  |  | LIBS=['rtio']) | 
| 52 | schorsch | 1.7 | progs.append(getinfo) | 
| 53 | schorsch | 1.1 |  | 
| 54 |  |  | # special targets not normally built | 
| 55 | schorsch | 1.2 | if os.name != 'nt': # XXX pending replacement of fork() and friends | 
| 56 |  |  | scanner = env.Program(target=radbin('scanner'), source='scanner.c', | 
| 57 |  |  | LIBS=mlib) | 
| 58 | schorsch | 1.7 | scanner_i = env.Install('$RAD_BINDIR', scanner) | 
| 59 | schorsch | 1.2 | makedist = env.Program(target=radbin('makedist'), | 
| 60 | schorsch | 1.4 | source=Split('makedist.c')+[setscan], | 
| 61 |  |  | LIBS=['rtmath']+mlib) | 
| 62 | schorsch | 1.7 | makedist_i = env.Install('$RAD_BINDIR', makedist) | 
| 63 | schorsch | 1.2 | env.Alias('util_special', [scanner, makedist]) | 
| 64 |  |  | env.Alias('util_special_install', [scanner_i, makedist_i]) | 
| 65 | schorsch | 1.1 |  | 
| 66 |  |  | # X11 targets | 
| 67 | schorsch | 1.2 | if env.has_key('X11LIB'): | 
| 68 | schorsch | 1.7 | xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] | 
| 69 |  |  | xlibp = env.get('LIBPATH', []) + ['$X11LIB'] | 
| 70 | schorsch | 1.6 | x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice | 
| 71 |  |  | CPPPATH=xincl) | 
| 72 | schorsch | 1.2 | xglaresrc = env.Program(target=radbin('xglaresrc'), | 
| 73 | schorsch | 1.5 | source=Split('xglaresrc.c') + [x11findwind], | 
| 74 | schorsch | 1.2 | LIBPATH=xlibp, CPPPATH=xincl, | 
| 75 |  |  | LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib) | 
| 76 | schorsch | 1.7 | progs.append(xglaresrc) | 
| 77 | schorsch | 1.2 |  | 
| 78 |  |  | # OpenGL targets that also depend on X11 | 
| 79 |  |  | if env.has_key('OGL'): | 
| 80 |  |  | glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'), | 
| 81 | schorsch | 1.7 | CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'], | 
| 82 | schorsch | 1.2 | LIBPATH=xlibp, CPPPATH=xincl, | 
| 83 |  |  | LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs', | 
| 84 |  |  | 'rtmath','rtcont','rtmem','rterror', | 
| 85 |  |  | 'GL', 'GLU','X11'],) | 
| 86 | schorsch | 1.7 | progs.append(glrad) | 
| 87 | schorsch | 1.1 |  | 
| 88 | schorsch | 1.7 | if os.name == 'posix': # XXX ignoring trad.wsh | 
| 89 |  |  | for s in Split('''objview objline objpict | 
| 90 |  |  | glare dayfact debugcal rlux raddepend compamb vinfo genambpos'''): | 
| 91 |  |  | Default(env.InstallCsh(radbin(s), s + '.csh')) | 
| 92 |  |  |  | 
| 93 |  |  | Default('#src/util') | 
| 94 |  |  | env.Install('$RAD_BINDIR', progs) | 
| 95 | schorsch | 1.1 |  |