| 1 |
schorsch |
1.1 |
import os |
| 2 |
|
|
|
| 3 |
|
|
Import ('env') |
| 4 |
|
|
|
| 5 |
|
|
# make a modified local copy |
| 6 |
|
|
meta = env.Copy(LIBS=['rt'] + env['RAD_MLIB']) |
| 7 |
|
|
|
| 8 |
|
|
# compose paths |
| 9 |
|
|
def radbin(name): return os.path.join(meta['RAD_BUILDBIN'], name) |
| 10 |
|
|
def radlib(name): return os.path.join(meta['RAD_BUILDLIB'], name) |
| 11 |
|
|
|
| 12 |
|
|
#meta.Append(CPPFLAGS = ' -DMDIR=\\"' + meta['RAD_RLIBDIR'] + '\\"') |
| 13 |
|
|
|
| 14 |
|
|
# some files need an extra flag |
| 15 |
|
|
MDIRFLAGS = meta.get('CPPFLAGS', []) + [ |
| 16 |
|
|
'-DMDIR=\\"%s\\"' % os.path.join(meta['RAD_RLIBDIR'], 'meta')] |
| 17 |
|
|
bgraph = meta.Object(source='bgraph.c', CPPFLAGS=MDIRFLAGS) |
| 18 |
|
|
igraph = meta.Object(source='igraph.c', CPPFLAGS=MDIRFLAGS) |
| 19 |
|
|
dgraph = meta.Object(source='dgraph.c', CPPFLAGS=MDIRFLAGS) |
| 20 |
|
|
gcomp = meta.Object(source='gcomp.c', CPPFLAGS=MDIRFLAGS) |
| 21 |
|
|
syscalls = meta.Object(source='syscalls.c', CPPFLAGS=MDIRFLAGS) |
| 22 |
|
|
|
| 23 |
|
|
common = Split('mfio.c misc.c') + [syscalls] |
| 24 |
|
|
|
| 25 |
|
|
libmeta = meta.StaticLibrary(radlib('meta'), |
| 26 |
|
|
Split ('metacalls.c primout.c progname.c') + common) |
| 27 |
|
|
|
| 28 |
|
|
# standard targets |
| 29 |
|
|
PROGS = ( |
| 30 |
|
|
('meta2tga', Split('meta2tga.c rplot.c plot.c palloc.c') + common), |
| 31 |
|
|
('pexpand', Split('pexpand.c expand.c segment.c palloc.c') + common), |
| 32 |
|
|
('psort', Split('psort.c sort.c palloc.c') + common), |
| 33 |
|
|
('cv', Split('cv.c cvhfio.c') + common), |
| 34 |
|
|
('psmeta', Split('psmeta.c psplot.c') + common), |
| 35 |
|
|
('plotin', Split('plotin.c primout.c') + common), |
| 36 |
|
|
('bgraph', Split('mgvars.c mgraph.c') + [bgraph, libmeta]), |
| 37 |
|
|
('igraph', Split('mgvars.c mgraph.c gcalc.c cgraph.c') + [igraph, libmeta]), |
| 38 |
|
|
('dgraph', Split('cgraph.c mgvars.c') + [dgraph]), |
| 39 |
|
|
('gcomp', Split('gcalc.c mgvars.c') + [gcomp]), |
| 40 |
|
|
('plot4', Split('plot4.c primout.c') + common), |
| 41 |
|
|
) |
| 42 |
|
|
for p in PROGS: |
| 43 |
|
|
prog = meta.Program(target=radbin(p[0]), |
| 44 |
|
|
source=p[1]) |
| 45 |
|
|
Default(prog) |
| 46 |
|
|
env.Append(RAD_BININSTALL=[meta.Install(meta['RAD_BINDIR'], prog)]) |
| 47 |
|
|
|
| 48 |
|
|
|
| 49 |
|
|
lib4014srcs = Split('''arc.c box.c circle.c close.c dot.c erase.c label.c |
| 50 |
|
|
line.c linemod.c move.c open.c point.c space.c subr.c''') |
| 51 |
|
|
lib4014 = env.Library(os.path.join(env['RAD_BUILDLIB'], '4014'), |
| 52 |
|
|
source=map(lambda s:os.path.join('lib4014', s), lib4014srcs)) |
| 53 |
|
|
|
| 54 |
|
|
plotsrc = Split('mplot.c plot.c palloc.c') |
| 55 |
|
|
|
| 56 |
|
|
SPECIAL = ( |
| 57 |
|
|
('mt160l', Split('mt160l.c') + plotsrc + common), # rt |
| 58 |
|
|
('mt160', Split('mt160.c') + plotsrc + common), # rt m |
| 59 |
|
|
('mtext', Split('mtext.c primout.c') + common), # rt |
| 60 |
|
|
('okimate', Split('okimate.c') + plotsrc + common), # rt |
| 61 |
|
|
('mx80', Split('mx80.c') + plotsrc + common), # rt m |
| 62 |
|
|
('imagew', Split('imagew.c') + plotsrc + common), # rt m |
| 63 |
|
|
('impress', Split('impress.c implot.c imPfuncs.c plot.c') + common), # rt m |
| 64 |
|
|
('aed5', Split('aed5.c') + common), # rt m |
| 65 |
|
|
('tcurve', Split('tcurve.c tgraph.c primout.c') + common), # m |
| 66 |
|
|
('tscat', Split('tscat.c tgraph.c primout.c') + common), # rt m |
| 67 |
|
|
('tbar', Split('tbar.c tgraph.c primout.c') + common), # rt m |
| 68 |
|
|
) |
| 69 |
|
|
sbin = [] |
| 70 |
|
|
sinst = [] |
| 71 |
|
|
for p in SPECIAL: |
| 72 |
|
|
prog = meta.Program(target=radbin(p[0]), source=p[1]) |
| 73 |
|
|
sbin.append(prog) |
| 74 |
|
|
sinst.append(meta.Install(meta['RAD_BINDIR'], prog)) |
| 75 |
|
|
#plotout = meta.Program(target=radbin('plotout'), source=['plotout.c'] + common, |
| 76 |
|
|
# LIBS=['plot', '4014', 'rt', 'm']) |
| 77 |
|
|
#t4014 = meta.Program(target=radbin('t4014'), source=['plotout.c'] + common, |
| 78 |
|
|
# LIBS=['4014', 'rt', 'm'], CPPFLAGS=meta.get('CPPFLAGS',[]) + ['-DFORTEK']) |
| 79 |
|
|
meta.Alias('meta_special', sbin)# + [plotout, t4014]) |
| 80 |
|
|
meta.Alias('meta_special_install', sinst) |
| 81 |
|
|
|
| 82 |
|
|
# X11 targets |
| 83 |
|
|
if meta.has_key('X11LIB'): |
| 84 |
|
|
meta.Append(CPPPATH=meta['X11INCLUDE']) |
| 85 |
|
|
meta.Append(LIBS='X11') |
| 86 |
|
|
meta.Append(LIBPATH=meta['X11LIB']) |
| 87 |
|
|
x11meta = meta.Program(radbin('x11meta'), |
| 88 |
|
|
Split('plotin.c primout.c') + common) |
| 89 |
|
|
Default(x11meta) |
| 90 |
|
|
env.Append(RAD_BININSTALL=[meta.Install(meta['RAD_BINDIR'], x11meta)]) |
| 91 |
|
|
|
| 92 |
|
|
|