summaryrefslogtreecommitdiffstats
path: root/trivia/sensommarfest/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'trivia/sensommarfest/Makefile')
-rw-r--r--trivia/sensommarfest/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/trivia/sensommarfest/Makefile b/trivia/sensommarfest/Makefile
new file mode 100644
index 0000000..5816045
--- /dev/null
+++ b/trivia/sensommarfest/Makefile
@@ -0,0 +1,30 @@
+
+ALL = \
+ questions.pdf \
+ answers.pdf \
+ form.pdf
+
+TMP = tmp
+
+all: $(ALL)
+
+answers.pdf questions.pdf: trivia.mdwn
+ mkdir -p $(TMP)
+ cat $< | sed -f sed/$(basename $@).sed > $(TMP)/$(basename $@).mdwn
+ cat $(TMP)/$(basename $@).mdwn | pandoc -s -f markdown -t latex \
+ -N -H tex/header.tex -V classoption=a6paper,11pt -V pagestyle=empty \
+ | sed -f sed/latex.sed -f sed/$(basename $@).sed > $(TMP)/$(basename $@)-small.tex
+ pdflatex -output-directory $(TMP) -jobname $(basename $@)-small < $(TMP)/$(basename $@)-small.tex
+ cat tex/$(basename $@).tex \
+ | pdflatex -output-directory $(TMP) -jobname $(basename $@)
+ mv $(TMP)/$@ $@
+
+form.pdf: tex/form.tex
+ mkdir -p $(TMP)
+ pdflatex -output-directory $(TMP) -jobname $(basename $@) < $<
+ mv $(TMP)/$@ $@
+
+
+clean:
+ rm -f $(ALL)
+ rm -fr $(TMP)