Remove some progress documents, they are being stored elsewhere.
[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 # Limit to 500MB of virtual memory
23 contextBuilder = Builder(action='ulimit -v 512000; nice texexec --lua $SOURCE%s' % once,
24                          suffix='.pdf',
25                          src_suffix='.tex')
26 env.Append(BUILDERS={'Context': contextBuilder})
27
28 # Import tex settings from the user environment
29 env['ENV']['TEXMFCNF'] = os.environ['TEXMFCNF']
30 env['ENV']['HOME'] = os.environ['HOME']
31 # Allow the SSH agent to be used
32 env['ENV']['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK']
33
34 #### The actual builds.
35
36 ## Core2Core document
37 core2core = env.Context('Core2Core')
38 Depends(core2core, 'pret-lam.lua')
39 Depends(core2core, 'pret-trans.lua')
40
41 ## Report
42 report = env.Context('Report')
43 Depends(report, glob.glob('pret-*.lua'))
44 Depends(report, glob.glob('Chapters/*.tex'))
45 Depends(report, glob.glob('Utils/*.tex'))
46 Depends(report, glob.glob('Titlepage.tex'))
47
48 AddPostAction(report, 'scp $TARGET ewi:')
49
50 Default(DEFAULT_TARGET)