From: Matthijs Kooijman Date: Mon, 27 Jul 2009 12:43:40 +0000 (+0200) Subject: Clean up SConstruct file. X-Git-Tag: final-thesis~309 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=32d52cda513c45334ab256c9f42d41ed6938fc48;p=matthijs%2Fmaster-project%2Freport.git Clean up SConstruct file. --- diff --git a/SConstruct b/SConstruct index 4e2e3e5..29ca6be 100644 --- a/SConstruct +++ b/SConstruct @@ -6,49 +6,11 @@ import os.path #### Some configurations. -LATEX_PROJECT = 'Core2Core' - -DEFAULT_TARGET = 'pdf' - -GNUPLOT_DIAGRAMS = [] - -EPS_FIGURES = [] - -PDF_FIGURES = [] - -## Some rather fixed configurations: - -GNUPLOT_DIRECTORY = 'images' -GNUPLOT_EXTENSION = '.gnuplot' -EPS_DIRECTORY = 'eps' -EPS_EXTENSION = '.eps' -PDF_DIRECTORY = 'pdf' -PDF_EXTENSION = '.pdf' - -#MAKEINDEX_EXTENSIONS = ['.glg', '.glo', '.gls'] - +DEFAULT_TARGET = 'Core2Core.pdf' #### Defining some new builders. env = Environment() -## eps2pdf Builder: -pdfBuilder = Builder(action='epstopdf $SOURCE --outfile=$TARGET', - suffix='.pdf', - src_suffix='.eps') -env.Append(BUILDERS={'Eps2pdf': pdfBuilder}) - -## eps2eps Builder: -epsBuilder = Builder(action='pdftops -eps -level3 $SOURCE $TARGET', - suffix='.eps', - src_suffix='.pdf') -env.Append(BUILDERS={'Pdf2eps': epsBuilder}) - -## GNUplot Builder: -gnuplotBuilder = Builder(action='gnuplot $SOURCE', - suffix='.eps', - src_suffix='.gnuplot') -env.Append(BUILDERS={'Gnuplot': gnuplotBuilder}) - ## Context MkIV Builder: contextBuilder = Builder(action=['texexec --lua $SOURCE','scp $TARGET ewi:'], suffix='.pdf', @@ -61,55 +23,11 @@ env['ENV']['HOME'] = os.environ['HOME'] # Allow the SSH agent to be used env['ENV']['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK'] - #### The actual builds. -## Context PDF build -pdfOutput = env.Context(LATEX_PROJECT) -Depends(pdfOutput, 'pret-lam.lua') -Depends(pdfOutput, 'pret-trans.lua') -env.Alias('pdf', LATEX_PROJECT + '.pdf') - -# Keep below code happy -dviOutput = pdfOutput +## Core2Core document +core2core = env.Context('Core2Core') +Depends(core2core, 'pret-lam.lua') +Depends(core2core, 'pret-trans.lua') Default(DEFAULT_TARGET) - -## Create makeindex file list for dependencies and clean up: -#for item in MAKEINDEX_EXTENSIONS: -# fileName = os.path.join(LATEX_PROJECT + item) -# Depends(dviOutput, fileName) -# Depends(pdfOutput, fileName) -# Clean(dviOutput, fileName) -# Clean(pdfOutput, fileName) - -## Build GNUplot figures: -for item in GNUPLOT_DIAGRAMS: - gnuplotFile = os.path.join(GNUPLOT_DIRECTORY, item + GNUPLOT_EXTENSION) - epsFile = os.path.join(EPS_DIRECTORY, item + EPS_EXTENSION) - pdfFile = os.path.join(PDF_DIRECTORY, item + PDF_EXTENSION) - - env.Gnuplot(epsFile, gnuplotFile) - dep = env.Eps2pdf(pdfFile, epsFile) - Depends(dep, epsFile) - - Depends(dviOutput, pdfFile) - Depends(pdfOutput, pdfFile) - -## Build PDF figures: -for item in PDF_FIGURES: - epsFile = os.path.join(EPS_DIRECTORY, item + EPS_EXTENSION) - pdfFile = os.path.join(PDF_DIRECTORY, item + PDF_EXTENSION) - - env.Pdf2eps(epsFile, pdfFile) - - Depends(dviOutput, epsFile) - -## Build EPS figures: -for item in EPS_FIGURES: - epsFile = os.path.join(EPS_DIRECTORY, item + EPS_EXTENSION) - pdfFile = os.path.join(PDF_DIRECTORY, item + PDF_EXTENSION) - - env.Eps2pdf(pdfFile, epsFile) - - Depends(pdfOutput, pdfFile)