X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=SConstruct;h=3411e32d2058068fbc741924a660b9fbf24df6a4;hp=a25c1623e3ba23be205a58b0ad8814fc4041c42b;hb=daa8bdad58317f7c61f86b4152aa81297f7ef624;hpb=a7321efea813c68cf303360603369e5e39adbe7c diff --git a/SConstruct b/SConstruct index a25c162..3411e32 100644 --- a/SConstruct +++ b/SConstruct @@ -6,51 +6,13 @@ 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 = 'Report.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:'], +contextBuilder = Builder(action='texexec --lua $SOURCE', suffix='.pdf', src_suffix='.tex') env.Append(BUILDERS={'Context': contextBuilder}) @@ -61,53 +23,24 @@ 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) -env.Alias('pdf', LATEX_PROJECT + '.pdf') - -# Keep below code happy -dviOutput = pdfOutput - -Default(DEFAULT_TARGET) +## Core2Core document +core2core = env.Context('Core2Core') +Depends(core2core, 'pret-lam.lua') +Depends(core2core, 'pret-trans.lua') -## 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) +## Report +report = env.Context('Report') +Depends(report, 'pret-lam.lua') +Depends(report, 'pret-trans.lua') +Depends(report, 'pret-haskell.lua') +Depends(report, 'Chapters/State.tex') +Depends(report, 'Utils/Fonts.tex') +Depends(report, 'Utils/Formats.tex') +Depends(report, 'Utils/Lambda.tex') +Depends(report, 'Utils/Shortcuts.tex') -## 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) +AddPostAction(report, 'scp $TARGET ewi:') - 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) +Default(DEFAULT_TARGET)