15 |
Import('*') |
Import('*') |
16 |
local_env = env.Clone() |
local_env = env.Clone() |
17 |
|
|
18 |
latexmode='-interaction=nonstopmode' |
tex_src = Glob('*.tex')+Glob('*.bib')+Glob('*.sty')+Glob('*.cfg')+Glob('*.cls') |
19 |
|
fig_src = Glob('figures/*.png') |
20 |
|
|
21 |
tex_dir = local_env.Dir('.').srcnode().abspath |
if local_env['verbose']: |
22 |
dir_cmd = "cd "+tex_dir+" && " |
interaction='-interaction=nonstopmode' |
23 |
tex= [ env.File(x) for x in os.listdir(tex_dir) if not x.startswith('.') and not os.path.isdir(tex_dir+os.path.sep+x) and os.path.splitext(x)[1] in ['.tex', '.bib', '.sty', '.cfg', '.cls'] ] + \ |
else: |
24 |
[ env.File('figures'+os.path.sep+x) for x in os.listdir(tex_dir+os.path.sep+'figures') if not x.startswith('.') ] |
interaction='-interaction=batchmode' |
25 |
|
|
26 |
latexcmd=dir_cmd+"pdflatex %s \\\\newcommand{\\\\RepVersion}{`svnversion`\\\\xspace}\\\\input{cookbook.tex}"%latexmode |
# Define command to include SVN revision |
27 |
|
local_env.Append(PDFLATEXFLAGS=[interaction,'\\\\newcommand{\\\\RepVersion}{%s\\\\xspace}\\\\input{cookbook.tex}'%(local_env['svn_revision'])]) |
28 |
local_env.Command(env['prefix']+'/doc/cookbook/cookbook.pdf',[tex], \ |
pdf=local_env.PDF(target='cookbook.pdf', source='cookbook.tex') |
29 |
[ latexcmd, \ |
Depends(pdf, fig_src+tex_src) |
|
# "bibtex cookbook", \ |
|
|
dir_cmd+"makeindex cookbook", \ |
|
|
latexcmd, \ |
|
|
latexcmd ] \ |
|
|
) |
|
30 |
|
|
31 |
tmp=local_env.InstallAs(target=env['prefix']+'/release/doc/cookbook/cookbook.pdf', source=env['prefix']+'/doc/cookbook/cookbook.pdf') |
pdf_inst=local_env.InstallAs(target=env['prefix']+'/release/doc/cookbook/cookbook.pdf', source=pdf) |
32 |
|
|
33 |
env.Alias('cookbook_pdf', tmp) |
env.Alias('cookbook_pdf', pdf_inst) |
34 |
|
|