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

Contents of /trunk/ascend/compiler/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2326 - (show annotations) (download)
Tue Dec 21 11:35:07 2010 UTC (11 years, 6 months ago) by jpye
File size: 3318 byte(s)
Comment out some disused functions and variables (reverse_ad.c, cmslv.c, relation.c).
Add comments about ascConfig.h->platform.h rename.
Address some compiler warnings with minor code changes in ospath and importhandler.
1 #!/usr/bin/python invoke_using_scons
2 Import('libascend_env')
3
4 csrcs = Split("""
5 anoncopy.c anonmerg.c anontype.c arrayinst.c ascCompiler.c
6 atomsize.c atomvalue.c bintoken.c braced.c
7 case.c check.c child.c childdef.c childio.c childinfo.c cmpfunc.c
8 commands.c copyinst.c createinst.c defaultpaths.c destroyinst.c
9 dimen.c dimen_io.c dump.c
10 evaluate.c exprio.c exprs.c exprsym.c extcall.c
11 extfunc.c extinst.c find.c forvars.c fractions.c
12 freestore.c func.c findpath.c
13 importhandler.c initialize.c instance_io.c
14 instantiate.c instmacro.c instquery.c
15 library.c linkinst.c logrel_io.c logrel_util.c
16 logrelation.c mathinst.c mergeinst.c module.c name.c
17 nameio.c notate.c notequery.c numlist.c parentchild.c
18 parpend.c pending.c plot.c proc.c procframe.c
19 procio.c prototype.c qlfdid.c refineinst.c rel_common.c relation.c
20 rel_blackbox.c
21 relation_io.c relation_util.c rootfind.c reverse_ad.c
22 safe.c
23 select.c setinst_io.c setinstval.c setio.c
24 sets.c slist.c slvreq.c simlist.c statement.c statio.c switch.c
25 symtab.c syntax.c temp.c tmpnum.c type_desc.c
26 type_descio.c typedef.c typelint.c
27 units.c universal.c
28 value_type.c visitinst.c visitlink.c vlist.c vlistio.c
29 watchpt.c watchptio.c when.c when_io.c when_util.c
30 """)
31
32 import platform, glob
33
34 scanparse_env = libascend_env.Clone()
35
36 scanparse_env.Append(CCFLAGS=scanparse_env.get('YACC_CCFLAGS'))
37
38 if scanparse_env.has_key('HAVE_YACC'):
39 parsersource = libascend_env.CFile('ascParse.y',YACCFLAGS=['-y','-d','-pzz_'])
40 #libascend_env.SideEffect('ascParse.h',parsersource)
41 # backup the lex output for use by people without lex:
42 if libascend_env.get('UPDATE_NO_YACC_LEX'):
43 libascend_env.Command('ascParse_no_yacc.c',parsersource[0],Copy('$TARGET','$SOURCE'))
44 libascend_env.Command('ascParse_no_yacc.h',parsersource[1],Copy('$TARGET', '$SOURCE'))
45 else:
46 parserheader = libascend_env.Command('ascParse.h', 'ascParse_no_yacc.h',Copy('$TARGET', '$SOURCE'))
47 parsercode = libascend_env.Command('ascParse.c','ascParse_no_yacc.c',Copy('$TARGET','$SOURCE'))
48 parsersource = [parsercode,parserheader]
49
50 if scanparse_env.has_key('HAVE_LEX'):
51 scannersource = libascend_env.CFile('scanner.l',LEXFLAGS=['-l','-Pzz_'])
52 libascend_env.Depends(scannersource,parsersource)
53 # backup the lex output for use by people without lex:
54 if libascend_env.get('UPDATE_NO_YACC_LEX'):
55 libascend_env.Command('scanner_no_lex.c',scannersource,Copy('$TARGET','$SOURCE'))
56 else:
57 scannersource = libascend_env.Command('scanner.c','scanner_no_lex.c',Copy('$TARGET', '$SOURCE'))
58
59 packages_env = libascend_env.Clone()
60 packages = packages_env.SharedObject('packages.c')
61
62 objs = [parsersource[0],scannersource,packages]
63
64 # SLOPPY sources. This is a painful hack that should be fixed using 'config.h' style solution.
65
66 sloppy_csrcs = ['rounded.c','interval.c']
67
68 sloppy_env = libascend_env.Clone()
69 sloppy_env.Append(CPPDEFINES=['SLOPPY']);
70 for s in sloppy_csrcs:
71 objs += sloppy_env.SharedObject(s)
72
73 #libascend_env.Depends(scanner,[parsersource[1]])
74
75 for s in [csrcs]:
76 objs += libascend_env.SharedObject(s)
77
78 #--------------------
79 # INSTALL
80
81 if libascend_env.get('CAN_INSTALL'):
82 installdir = Dir(libascend_env.subst("$INSTALL_ROOT$INSTALL_INCLUDE/ascend/compiler"))
83
84 headers = glob.glob("*.h")
85 libascend_env.InstallHeader(installdir,headers)
86
87 Return('objs')
88
89 # vim: set syntax=python:
90

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