Add some references to the context chapter.
[matthijs/master-project/report.git] / SConstruct
1 # Based on the Latex SConstruct at
2 # https://gutefee.massey.ac.nz/moin/HOWTO/LaTeX/LaTeX-SCons-Builder
3 #
4 import os
5 import os.path
6 import glob
7
8 #### Some configurations.
9
10 DEFAULT_TARGET = 'Report.pdf'
11
12 #### Defining some new builders.
13 env = Environment()
14
15 ## Context MkIV Builder. Allow once=1 to just run once without fixing
16 # all references and tables.
17 if ARGUMENTS.get('once'):
18         once = ' --once'
19 else:
20         once = ''
21
22 contextBuilder = Builder(action='nice texexec --lua $SOURCE%s' % once,
23                          suffix='.pdf',
24                          src_suffix='.tex')
25 env.Append(BUILDERS={'Context': contextBuilder})
26
27 # Import tex settings from the user environment
28 env['ENV']['TEXMFCNF'] = os.environ['TEXMFCNF']
29 env['ENV']['HOME'] = os.environ['HOME']
30 # Allow the SSH agent to be used
31 env['ENV']['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK']
32
33 #### The actual builds.
34
35 ## Core2Core document
36 core2core = env.Context('Core2Core')
37 Depends(core2core, 'pret-lam.lua')
38 Depends(core2core, 'pret-trans.lua')
39
40 ## Report
41 report = env.Context('Report')
42 Depends(report, glob.glob('pret-*.lua'))
43 Depends(report, glob.glob('Chapters/*.tex'))
44 Depends(report, glob.glob('Utils/*.tex'))
45
46 AddPostAction(report, 'scp $TARGET ewi:')
47
48 Default(DEFAULT_TARGET)