introduction/main.tex: Fix 'ion strength' -> 'ionic strength'
[thesis.git] / src / SConscript
1 from distutils.sysconfig import get_python_lib
2 import os.path
3 import SCons.Scanner
4
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
8
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',
16     })
17 if 'DISPLAY' in os.environ:
18    env['ENV']['DISPLAY'] = os.environ['DISPLAY']
19
20 asymptote.generate(env)
21 gnuplot.generate(env)
22 pymol.generate(env)
23
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!'
29         Exit(1)
30     conf.CheckExec('dot')
31     env = conf.Finish()
32
33 # Include sub-SConscript files with rules for figures, packages, etc.
34 env = include_child_SConscripts(env, SConscript)
35
36 # Alias the thesis' base latex, which is used by when building the
37 # Asymptote graphics.
38 env.Alias('latex-base', [Glob('*.tex'), env.Alias('extra-packages')])
39
40 # Alias Bibtex files (?since SCons' LaTeX scanned isn't picking them up?)
41 env.Alias('bibtex-files', recursive_glob(env, '*.bib'))
42
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'))
48
49 Return('thesis')
50
51 #thesis.pdf : build
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)