1 # Based on the Latex SConstruct at
2 # https://gutefee.massey.ac.nz/moin/HOWTO/LaTeX/LaTeX-SCons-Builder
8 #### Some configurations.
10 DEFAULT_TARGET = 'Report.pdf'
12 #### Defining some new builders.
15 ## Context MkIV Builder. Allow once=1 to just run once without fixing
16 # all references and tables.
17 if ARGUMENTS.get('once'):
22 # Limit to 500MB of virtual memory
23 contextBuilder = Builder(action='ulimit -v 512000; nice texexec --lua $SOURCE%s' % once,
26 env.Append(BUILDERS={'Context': contextBuilder})
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']
34 #### The actual builds.
37 core2core = env.Context('Core2Core')
38 Depends(core2core, 'pret-lam.lua')
39 Depends(core2core, 'pret-trans.lua')
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'))
48 AddPostAction(report, 'scp $TARGET ewi:')
50 Default(DEFAULT_TARGET)