diff options
author | Steven Knight <knight@baldmt.com> | 2005-11-28 15:38:55 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-11-28 15:38:55 (GMT) |
commit | 3a9d39cb5a4e0bc20767f2f90de3023d0a7a89bd (patch) | |
tree | 1381ee0bcb9a5a756d60de793fda0843b6faffc5 /src | |
parent | c4556572f24937672f151f796efff9d0058aa670 (diff) | |
download | SCons-3a9d39cb5a4e0bc20767f2f90de3023d0a7a89bd.zip SCons-3a9d39cb5a4e0bc20767f2f90de3023d0a7a89bd.tar.gz SCons-3a9d39cb5a4e0bc20767f2f90de3023d0a7a89bd.tar.bz2 |
Add a TeX emitter to cover removal of .aux and .log files. (Joel B. Mohler)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Defaults.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/latex.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/pdflatex.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/pdftex.py | 1 | ||||
-rw-r--r-- | src/engine/SCons/Tool/tex.py | 6 |
6 files changed, 18 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index eead5e9..9b0154c 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -469,6 +469,9 @@ RELEASE 0.97 - XXX when it's necessary, to call $MAKEINDEX when it's necessary, and to call $TEX or $LATEX multiple times to handle undefined references. + - Add an emitter to the various TeX builders so that the generated + .aux and .log files also get deleted by the -c option. + From Elliot Murphy: - Enhance the tests to guarantee persistence of ListOption diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index b5e09b3..e51c870 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -132,14 +132,16 @@ def DVI(): # construction variable like $DVISUFFIX # because the output file name is # hard-coded within TeX. - suffix = '.dvi') + suffix = '.dvi', + emitter = {}) def PDF(): """A function for generating the PDF Builder.""" return SCons.Builder.Builder(action = { }, source_scanner = LaTeXScan, prefix = '$PDFPREFIX', - suffix = '$PDFSUFFIX') + suffix = '$PDFSUFFIX', + emitter = {}) # Common tasks that we allow users to perform in platform-independent # ways by creating ActionFactory instances. diff --git a/src/engine/SCons/Tool/latex.py b/src/engine/SCons/Tool/latex.py index 45150aa..c77461b 100644 --- a/src/engine/SCons/Tool/latex.py +++ b/src/engine/SCons/Tool/latex.py @@ -58,6 +58,8 @@ def generate(env): bld.add_action('.ltx', LaTeXAuxAction) bld.add_action('.latex', LaTeXAuxAction) + bld.add_emitter('.ltx', SCons.Tool.tex.tex_emitter) + bld.add_emitter('.latex', SCons.Tool.tex.tex_emitter) env['LATEX'] = 'latex' env['LATEXFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/pdflatex.py b/src/engine/SCons/Tool/pdflatex.py index ce3ba67..3b7ac40 100644 --- a/src/engine/SCons/Tool/pdflatex.py +++ b/src/engine/SCons/Tool/pdflatex.py @@ -55,6 +55,8 @@ def generate(env): bld.add_action('.ltx', PDFLaTeXAuxAction) bld.add_action('.latex', PDFLaTeXAuxAction) + bld.add_emitter('.ltx', SCons.Tool.tex.tex_emitter) + bld.add_emitter('.latex', SCons.Tool.tex.tex_emitter) env['PDFLATEX'] = 'pdflatex' env['PDFLATEXFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/pdftex.py b/src/engine/SCons/Tool/pdftex.py index 6606f0d..a25f08b 100644 --- a/src/engine/SCons/Tool/pdftex.py +++ b/src/engine/SCons/Tool/pdftex.py @@ -69,6 +69,7 @@ def generate(env): env['BUILDERS']['PDF'] = bld bld.add_action('.tex', PDFTeXLaTeXAction) + bld.add_emitter('.tex', SCons.Tool.tex.tex_emitter) env['PDFTEX'] = 'pdftex' env['PDFTEXFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py index b444f76..8b80a02 100644 --- a/src/engine/SCons/Tool/tex.py +++ b/src/engine/SCons/Tool/tex.py @@ -121,6 +121,11 @@ def TeXLaTeXFunction(target = None, source= None, env=None): TeXAction(target,source,env) return 0 +def tex_emitter( target, source, env ): + target.append( os.path.splitext( SCons.Util.to_String(source[0]) )[0] + ".aux" ) + target.append( os.path.splitext( SCons.Util.to_String(source[0]) )[0] + ".log" ) + return (target, source) + TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction, strfunction=None) def generate(env): @@ -132,6 +137,7 @@ def generate(env): env['BUILDERS']['DVI'] = bld bld.add_action('.tex', TeXLaTeXAction) + bld.add_emitter('.tex', tex_emitter) env['TEX'] = 'tex' env['TEXFLAGS'] = SCons.Util.CLVar('') |