/[ascend]/trunk/base/generic/compiler/SConscript
ViewVC logotype

Contents of /trunk/base/generic/compiler/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 721 - (show annotations) (download)
Mon Jul 3 06:22:42 2006 UTC (13 years, 6 months ago) by johnpye
File size: 2622 byte(s)
Added '--models' option to ascend-config.
Fixed a bug with packages.c wrt generating absolute paths to library files.
Added SCons directives to install header files in INSTALL_INCLUDE subdirs.
Changed rel.c so that init function is only run if provided in the package.
Added 'ospath_getabs' to convert relative paths into absolute paths by adding prefix of fully-resolved '.'
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 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 relation_io.c relation_util.c rootfind.c safe.c
19 select.c setinst_io.c setinstval.c setio.c
20 sets.c slist.c simlist.c statement.c statio.c switch.c
21 symtab.c syntax.c temp.c tmpnum.c type_desc.c
22 type_descio.c typedef.c typelint.c redirectFile.c
23 units.c universal.c
24 value_type.c visitinst.c visitlink.c vlist.c vlistio.c
25 watchpt.c watchptio.c when.c when_io.c when_util.c
26 """)
27
28 import platform, glob
29
30 if libascend_env.has_key('HAVE_YACC'):
31 parsersource = 'ascParse.y'
32 parserheader = 'ascParse.h'
33 else:
34 parsersource = 'ascParse_no_yacc.c'
35 parserheader = libascend_env.Command('ascParse.h', 'ascParse_no_yacc.h',Copy('$TARGET', '$SOURCE'))
36
37 if libascend_env.has_key('HAVE_LEX'):
38 scannersource = 'scanner.l'
39 else:
40 scannersource = 'scanner_no_flex.c'
41
42 parser = libascend_env.SharedObject(target=['ascParse'], source=parsersource
43 , YACCFLAGS=['-d','-pzz_']
44 )
45
46 scanner = libascend_env.SharedObject(target=['scanner'],source=scannersource
47 , LEXFLAGS=['-Pzz_']
48 )
49
50 packages_env = libascend_env.Copy()
51 packages_env.Append(CPPDEFINES=[('ASC_SHLIBSUFFIX','\\"'+libascend_env['SHLIBSUFFIX']+'\\"'),('ASC_SHLIBPREFIX','\\"'+libascend_env['SHLIBPREFIX']+'\\"')])
52 packages = packages_env.SharedObject('packages.c')
53
54 objs = [parser,scanner,packages]
55
56 # SLOPPY sources. This is a painful hack that should be fixed using 'config.h' style solution.
57
58 sloppy_csrcs = ['rounded.c','interval.c']
59
60 sloppy_env = libascend_env.Copy()
61 sloppy_env.Append(CPPDEFINES=['SLOPPY']);
62 for s in sloppy_csrcs:
63 objs += sloppy_env.SharedObject(s)
64
65 libascend_env.Depends(scanner,[parserheader])
66
67 for s in [csrcs]:
68 objs += libascend_env.SharedObject(s)
69
70 #--------------------
71 # INSTALL
72
73 if libascend_env.get('CAN_INSTALL'):
74 installdir = libascend_env['INSTALL_ROOT']+libascend_env['INSTALL_INCLUDE']+'/compiler'
75
76 headers = glob.glob("*.h")
77 libascend_env.InstallHeader(installdir,headers)
78
79 Return('objs')

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22