| 1 | schorsch | 1.1 | import os | 
| 2 |  |  |  | 
| 3 |  |  | Import ('env') | 
| 4 |  |  |  | 
| 5 |  |  | # math libs | 
| 6 |  |  | mlib = env['RAD_MLIB'] | 
| 7 |  |  |  | 
| 8 |  |  | # compose paths | 
| 9 | schorsch | 1.6 | def rbin(name): return os.path.join(env['RAD_BUILDBIN'], name) | 
| 10 |  |  | def rlib(name): return os.path.join(env['RAD_BUILDLIB'], name) | 
| 11 |  |  | def mgfs(src): return map(lambda s:os.path.join('mgflib', s), src) | 
| 12 | schorsch | 1.1 |  | 
| 13 |  |  | MGFSRC = Split('''parser.c context.c xf.c object.c lookup.c badarg.c | 
| 14 |  |  | words.c | 
| 15 |  |  | fvect.c''') | 
| 16 | schorsch | 1.6 | libmgf = env.StaticLibrary(rlib('mgf'), source=mgfs(MGFSRC)) | 
| 17 |  |  |  | 
| 18 | schorsch | 1.1 | MGFPROGS = ( | 
| 19 |  |  | ('mgfilt',  Split('mgfilt.c')), | 
| 20 |  |  | ('mgf2inv', Split('mgf2inv.c cvrgb.c')), | 
| 21 |  |  | ('3ds2mgf', Split('3ds2mgf.c rayopt.c vect.c')), | 
| 22 |  |  | ) | 
| 23 |  |  | for p in MGFPROGS: | 
| 24 | schorsch | 1.6 | prog = env.Program(target=rbin(p[0]), source=mgfs(p[1]), LIBS=mlib+['mgf']) | 
| 25 | schorsch | 1.1 | Default(prog) | 
| 26 |  |  | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) | 
| 27 |  |  |  | 
| 28 | schorsch | 1.2 | trans = env.Object(source="trans.c") | 
| 29 |  |  |  | 
| 30 | schorsch | 1.1 | # standard targets | 
| 31 |  |  | PROGS = [ | 
| 32 | schorsch | 1.2 | ('ies2rad',   ['ies2rad.c'],       ['rtlamps','rtcolor','rtio','rtpath']+ mlib), | 
| 33 |  |  | ('arch2rad',  ['arch2rad.c',trans],['rtcont','rtmem'] + mlib), | 
| 34 |  |  | ('nff2rad',   ['nff2rad.c'],       []), | 
| 35 | schorsch | 1.4 | ('lampcolor', ['lampcolor.c'],     ['rtlamps','rtcolor','rtio','rtpath']), | 
| 36 | schorsch | 1.2 | ('tmesh2rad', ['tmesh2rad.c'],     ['rtscene','rtmath'] + mlib), | 
| 37 |  |  | ('obj2rad',   ['obj2rad.c',trans], | 
| 38 |  |  | ['rtscene','rtargs','rtio','rtcont','rtmem','rtmath','rterror'] + mlib), | 
| 39 |  |  | ('mgf2rad',   ['mgf2rad.c'],       ['rtscene','rtcolor','mgf'] + mlib), | 
| 40 |  |  | ('rad2mgf',   ['rad2mgf.c'], | 
| 41 |  |  | ['rtproc', 'rtpath', # for win_popen() | 
| 42 |  |  | 'rtscene','rtio','rtcolor','rtcont','rtmem','rterror'] + mlib), | 
| 43 | schorsch | 1.1 | ] | 
| 44 |  |  | for p in PROGS: | 
| 45 | schorsch | 1.6 | prog = env.Program(target=rbin(p[0]), source=p[1], LIBS=p[2]) | 
| 46 | schorsch | 1.1 | Default(prog) | 
| 47 |  |  | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) | 
| 48 | schorsch | 1.3 |  | 
| 49 |  |  | # meta targets | 
| 50 | schorsch | 1.6 | prog = env.Program(target=rbin('mgf2meta'), source=['mgf2meta.c'], | 
| 51 | schorsch | 1.3 | CPPPATH=env.get('CPPPATH', []) + [os.path.join('#src','meta')], | 
| 52 |  |  | LIBS=['meta','rtmath','rtcont','rtmem','rterror','mgf'] + mlib) | 
| 53 | schorsch | 1.1 |  | 
| 54 | greg | 1.9 | LIBFILES = Split('source.cal tilt.cal window.cal') | 
| 55 | schorsch | 1.1 | env.Append(RAD_RLIBINSTALL=env.Install(env['RAD_RLIBDIR'], LIBFILES)) | 
| 56 |  |  |  | 
| 57 | schorsch | 1.7 | if os.name == 'posix': | 
| 58 |  |  | for s in Split('''optics2rad'''): | 
| 59 | schorsch | 1.8 | Default(env.InstallCsh(rbin(s), s + '.csh')) |