1 from distutils.sysconfig import get_python_lib
5 from site_cons.site_init import (
6 include_child_SConscripts, check_exec, recursive_glob)
7 from site_cons.site_tools import asymptote, gnuplot, pymol
9 # Make a new environment.
10 env = Environment(ENV={
11 'PATH':['/usr/local/bin', '/opt/bin', '/bin', '/usr/bin'],
12 'HOME':os.path.expanduser('~'),
13 'PYMOL_PATH':os.path.join(get_python_lib(), 'pymol'),
14 'PYMOL_DATA':'/usr/share/pymol/data',
15 'PYMOL_SCRIPTS':'/usr/share/pymol/scripts',
17 if 'DISPLAY' in os.environ:
18 env['ENV']['DISPLAY'] = os.environ['DISPLAY']
20 asymptote.generate(env)
24 if not env.GetOption('clean'):
25 # Configure the environment since we're not cleaning.
26 conf = Configure(env, custom_tests={'CheckExec':check_exec})
27 if not conf.CheckExec('pymol'):
28 print 'PyMol is not installed!'
33 # Include sub-SConscript files with rules for figures, packages, etc.
34 env = include_child_SConscripts(env, SConscript)
36 # Alias the thesis' base latex, which is used by when building the
38 env.Alias('latex-base', [Glob('*.tex'), env.Alias('extra-packages')])
40 # Alias Bibtex files (?since SCons' LaTeX scanned isn't picking them up?)
41 env.Alias('bibtex-files', recursive_glob(env, '*.bib'))
43 # Add a rule for the thesis itself.
44 thesis = env.PDF('root.tex')
45 env.Depends(thesis, env.Alias('extra-packages'))
46 env.Depends(thesis, env.Alias('asymptote-figures'))
47 env.Depends(thesis, env.Alias('bibtex-files'))
52 # (cd ./build && $(LATEX) root)
53 # (cd ./build && bibtex root)
54 # (cd ./build && $(LATEX) root)
55 # (cd ./build && bibtex root)
56 # (cd ./build && $(LATEX) root)
57 # (cd ./build && bibtex root)
58 # (cd ./build && makeindex root.nlo -s nomencl.ist -o root.nls)
59 # (cd ./build && makeindex root.idx)
60 # (cd ./build && $(LATEX) root)
61 # (cd ./build && $(LATEX) root)