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

Contents of /trunk/models/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2016 - (show annotations) (download)
Tue Apr 28 09:30:57 2009 UTC (10 years, 11 months ago) by jpye
File size: 1415 byte(s)
Trying to fix up ASCEND for change of model library location to /usr/lib/ascend/models.
1 #!/usr/bin/python scons
2 Import('env')
3
4 # Build directories that contain external libraries
5 env.SConscript(['johnpye/SConscript'],['env'])
6 env.SConscript(['test/SConscript'],['env'])
7 env.SConscript(['sensitivity/SConscript'],['env'])
8
9 # Hunt for all models in the directory structure
10 import os, os.path
11
12 modelfiles = []
13
14 excludedirs = ['.svn','CVS']
15 excludefiles = ['Makefile.in','SConscript','update-Makefile.pl']
16
17 modeldir = env.Dir(".").abspath
18 #print "MODEL DIR =",modeldir
19
20 cwd = os.getcwd()
21 os.chdir(modeldir)
22 for root,dirs,files in os.walk("."):
23 for d in dirs:
24 if d in excludedirs:
25 dirs.remove(d)
26 if "PACKAGE" in files:
27 print "FOUND 'PACKAGE' file in %s..." % root
28 p = file(os.path.join(root,"PACKAGE"))
29 f1 = []
30 for l in p:
31 l1 = l.strip()
32 if not len(l1) or l1[0]=="#":
33 continue
34 f1.append(l1)
35 files = f1
36
37 for f in files:
38 if f in excludefiles:
39 continue
40 #print "ADDING",os.path.normpath(os.path.join(root,f))
41 modelfiles.append( os.path.normpath(os.path.join(root,f)) )
42 os.chdir(cwd)
43
44 #print "CWD =",cwd
45
46 modelsroot = '$INSTALL_ROOT$INSTALL_MODELS'
47
48 installeddirs = []
49
50 for f in modelfiles:
51 head,tail = os.path.split(f)
52 targetdir = Dir(env.subst(modelsroot)+"/"+head)
53
54 if not targetdir in installeddirs:
55 installeddirs.append(targetdir)
56 env.InstallShared(targetdir,f)
57
58 #print "MODEL INSTALLED DIRS =",installeddirs
59 Return('installeddirs')
60
61 # vim: set syntax=python:
62

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