From: W. Trevor King Date: Wed, 28 Apr 2010 21:56:01 +0000 (-0400) Subject: Add Alias('asymptote-figures') for explicit \asyfig dependencies. X-Git-Tag: v1.0~401 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54cd1545ff312c40a38cc8707bc73fe5cb0554d5;p=thesis.git Add Alias('asymptote-figures') for explicit \asyfig dependencies. Also: * Use env.Alias and env.Depends vs. the bare SCons.Script forms. * Add figures/cantilever-sim/loading-rate.asy back to build tree. --- diff --git a/tex/site_cons/site_tools/asymptote.py b/tex/site_cons/site_tools/asymptote.py index 40de5ab..6d8aeb5 100644 --- a/tex/site_cons/site_tools/asymptote.py +++ b/tex/site_cons/site_tools/asymptote.py @@ -9,6 +9,10 @@ import doctest double_quoted_string_re = re.compile(r'"([^"]*)"', re.M) +# SCons' LaTeX scanner doesn't understand \asyfig{}, so keep track of +# all Asymptote graphics under a single phony target. +asyfigs = SCons.Script.Alias('asymptote-figures') + def asymptote_scan(node, env, path, arg=None): """ >>> class node (object): @@ -55,6 +59,8 @@ def asymptote_emitter(target, source, env): target.extend(['%s-comp.%s' % (filebase, ext) for ext in ['idx', 'log', 'nlo', 'pdf']]) source.append(SCons.Script.Alias('asytools')) + # side effect, keep track of all asymptote graphics. + env.Depends(asyfigs, target) return target, source AsymptoteAction = None diff --git a/tex/src/SConscript b/tex/src/SConscript index 268b382..0196373 100644 --- a/tex/src/SConscript +++ b/tex/src/SConscript @@ -32,11 +32,12 @@ env = include_child_SConscripts(env, SConscript) # Alias the thesis' base latex, which is used by asyprocess when # building the Asymptote graphics. -Alias('latex-base', [Glob('*.tex'), Alias('extra-packages')]) +env.Alias('latex-base', [Glob('*.tex'), env.Alias('extra-packages')]) # Add a rule for the thesis itself. thesis = env.PDF('root.tex') -Depends(thesis, Alias('extra-packages')) +env.Depends(thesis, env.Alias('extra-packages')) +env.Depends(thesis, env.Alias('asymptote-figures')) Return('thesis') diff --git a/tex/src/figures/asy/SConscript b/tex/src/figures/asy/SConscript index 3318e5c..e2f2360 100644 --- a/tex/src/figures/asy/SConscript +++ b/tex/src/figures/asy/SConscript @@ -2,7 +2,7 @@ Import('env') asy = env.Alias('asytools', ['asyprocess', 'wtk_graph.asy']) -Depends(asy, Alias('latex-base')) +env.Depends(asy, Alias('latex-base')) # Pass back the modified environment. Return('env') diff --git a/tex/src/figures/cantilever-sim/SConscript b/tex/src/figures/cantilever-sim/SConscript index ee40383..19e66cb 100644 --- a/tex/src/figures/cantilever-sim/SConscript +++ b/tex/src/figures/cantilever-sim/SConscript @@ -1,6 +1,6 @@ from site_cons.site_init import link_wtk_graph -FIGURES = ['v-dep', 'i-dep'] #'loading-rate', 'i-dep'] +FIGURES = ['v-dep', 'loading-rate', 'i-dep'] # Get the passed in environment. Import('env')