/[escript]/trunk/bruce/src/SConscript
ViewVC logotype

Annotation of /trunk/bruce/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 707 - (hide annotations)
Wed Apr 12 23:58:02 2006 UTC (14 years, 7 months ago) by gross
File size: 2366 byte(s)
latex build documentation is working now
1 gross 707 # Copyright 2006 by ACcESS MNRF
2     #
3     # http://www.access.edu.au
4     # Primary Business: Queensland, Australia
5     # Licensed under the Open Software License version 3.0
6     # http://www.opensource.org/licenses/osl-3.0.php
7     #
8     #
9     #
10 gross 700 import os
11 jgs 176 Import('*')
12    
13 robwdcock 682 local_env=env.Copy()
14     py_wrapper_local_env=env.Copy()
15     # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
16     del py_wrapper_local_env['SHLIBPREFIX']
17 jgs 176
18 robwdcock 682 lib_name = 'bruce'
19     py_wrapper_name = lib_name+'cpp'
20     py_wrapper_source = py_wrapper_name+'.cpp'
21     py_wrapper_lib_name = py_wrapper_name
22 jgs 277
23 gross 700 # get the relevant file names:
24 robwdcock 682 src_dir = local_env.Dir('.').srcnode().abspath
25 gross 700 filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
26 jgs 177
27 robwdcock 682 sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
28     headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
29     # Filter out sources that should not be in the list automatically
30     sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
31 jgs 277
32 robwdcock 682 local_env.Append(LIBS = [boost_lib, 'escript', 'esysUtils'])
33     py_wrapper_local_env.Append(LIBS = [boost_lib, lib_name, 'escript', 'esysUtils'])
34 jgs 277
35 robwdcock 682 lib = local_env.SharedLibrary(lib_name, sources)
36     py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
37 jgs 190
38 robwdcock 682 include_path = Dir(lib_name, incinstall)
39 jgs 481
40 robwdcock 682 local_env.Install(include_path, headers )
41     local_env.Install(libinstall, lib)
42     py_wrapper_local_env.Install(pyinstall+'/bruce', py_wrapper_lib)
43 jgs 176
44 robwdcock 682 # export the lib target since tests will depend on it
45     # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
46     # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
47     dep_lib = [libinstall+'/'+str(x) for x in lib]
48     Export('dep_lib')
49 jgs 277
50 gross 700 # add source files to release
51     release_srcfiles = [ env.File(x) for x in filenames ] + [env.File("SConscript"), ]
52     env.Zip(src_zipfile, release_srcfiles)
53     env.Tar(src_tarfile, release_srcfiles)
54    
55    
56 robwdcock 682 # Call the python sconscript
57     env.SConscript(dirs = ['#/bruce/py_src'], build_dir='py', duplicate=0)
58 jgs 277
59 robwdcock 682 # Call the unit tests SConscript
60     local_env.SConscript(dirs = ['#/bruce/test'], build_dir='#/build/$PLATFORM/bruce/test', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26