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 contextBuilder = Builder(action='nice texexec --lua $SOURCE%s' % once,
25 env.Append(BUILDERS={'Context': contextBuilder})
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']
33 #### The actual builds.
36 core2core = env.Context('Core2Core')
37 Depends(core2core, 'pret-lam.lua')
38 Depends(core2core, 'pret-trans.lua')
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'))
46 AddPostAction(report, 'scp $TARGET ewi:')
48 Default(DEFAULT_TARGET)