1 |
Import('libascend_env') |
2 |
|
3 |
csrcs = Split(""" |
4 |
anoncopy.c anonmerg.c anontype.c arrayinst.c ascCompiler.c |
5 |
atomsize.c atomvalue.c bintoken.c bit.c braced.c |
6 |
case.c check.c child.c childdef.c childio.c childinfo.c cmpfunc.c |
7 |
commands.c copyinst.c createinst.c destroyinst.c |
8 |
dimen.c dimen_io.c dump.c |
9 |
evaluate.c exprio.c exprs.c exprsym.c extcall.c |
10 |
extfunc.c extinst.c find.c forvars.c fractions.c |
11 |
freestore.c func.c importhandler.c initialize.c instance_io.c |
12 |
instantiate.c instmacro.c instquery.c |
13 |
library.c linkinst.c logrel_io.c logrel_util.c |
14 |
logrelation.c mathinst.c mergeinst.c module.c name.c |
15 |
nameio.c notate.c numlist.c parentchild.c |
16 |
parpend.c pending.c plot.c proc.c procframe.c |
17 |
procio.c prototype.c qlfdid.c refineinst.c rel_common.c relation.c |
18 |
rel_blackbox.c |
19 |
relation_io.c relation_util.c rootfind.c safe.c |
20 |
select.c setinst_io.c setinstval.c setio.c |
21 |
sets.c slist.c simlist.c statement.c statio.c switch.c |
22 |
symtab.c syntax.c temp.c tmpnum.c type_desc.c |
23 |
type_descio.c typedef.c typelint.c |
24 |
units.c universal.c |
25 |
value_type.c visitinst.c visitlink.c vlist.c vlistio.c |
26 |
watchpt.c watchptio.c when.c when_io.c when_util.c |
27 |
""") |
28 |
|
29 |
import platform, glob |
30 |
|
31 |
scanparse_env = libascend_env.Copy() |
32 |
|
33 |
scanparse_env.Append(CCFLAGS=scanparse_env.get('YACC_CCFLAGS')) |
34 |
|
35 |
if scanparse_env.has_key('HAVE_YACC'): |
36 |
parsersource = 'ascParse.y' |
37 |
parserheader = 'ascParse.h' |
38 |
else: |
39 |
parsersource = 'ascParse_no_yacc.c' |
40 |
parserheader = libascend_env.Command('ascParse.h', 'ascParse_no_yacc.h',Copy('$TARGET', '$SOURCE')) |
41 |
|
42 |
if scanparse_env.has_key('HAVE_LEX'): |
43 |
scannersource = 'scanner.l' |
44 |
else: |
45 |
scannersource = 'scanner_no_flex.c' |
46 |
|
47 |
parser = scanparse_env.SharedObject(target=['ascParse'], source=parsersource |
48 |
, YACCFLAGS=['-y','-d','-pzz_'] |
49 |
) |
50 |
|
51 |
scanner = libascend_env.SharedObject(target=['scanner'],source=scannersource |
52 |
, LEXFLAGS=['-l','-Pzz_'] |
53 |
) |
54 |
|
55 |
packages_env = libascend_env.Copy() |
56 |
packages_env.Append(CPPDEFINES=[('ASC_SHLIBSUFFIX','\\"'+libascend_env['SHLIBSUFFIX']+'\\"'),('ASC_SHLIBPREFIX','\\"'+libascend_env['SHLIBPREFIX']+'\\"')]) |
57 |
packages = packages_env.SharedObject('packages.c') |
58 |
|
59 |
objs = [parser,scanner,packages] |
60 |
|
61 |
# SLOPPY sources. This is a painful hack that should be fixed using 'config.h' style solution. |
62 |
|
63 |
sloppy_csrcs = ['rounded.c','interval.c'] |
64 |
|
65 |
sloppy_env = libascend_env.Copy() |
66 |
sloppy_env.Append(CPPDEFINES=['SLOPPY']); |
67 |
for s in sloppy_csrcs: |
68 |
objs += sloppy_env.SharedObject(s) |
69 |
|
70 |
libascend_env.Depends(scanner,[parserheader]) |
71 |
|
72 |
for s in [csrcs]: |
73 |
objs += libascend_env.SharedObject(s) |
74 |
|
75 |
#-------------------- |
76 |
# INSTALL |
77 |
|
78 |
if libascend_env.get('CAN_INSTALL'): |
79 |
installdir = libascend_env['INSTALL_ROOT']+libascend_env['INSTALL_INCLUDE']+'/compiler' |
80 |
|
81 |
headers = glob.glob("*.h") |
82 |
libascend_env.InstallHeader(installdir,headers) |
83 |
|
84 |
Return('objs') |
85 |
|
86 |
# vim: set syntax=python: |
87 |
|