2017-10-24 13:01:53 +00:00
|
|
|
PANDOC = pandoc
|
2016-11-10 14:13:26 +00:00
|
|
|
TEX = pandoc
|
2016-11-23 21:48:44 +00:00
|
|
|
texsrc = template.tex handin.md
|
2017-10-24 13:01:53 +00:00
|
|
|
htmlsrc = handin.md static/style.css
|
|
|
|
pdf = out.pdf
|
|
|
|
html = out.html static/style.css
|
|
|
|
FLAGS = --latex-engine=pdflatex --css=style.css
|
|
|
|
basename = $(shell basename $(CURDIR))
|
2016-11-10 14:13:26 +00:00
|
|
|
|
2017-10-24 13:01:53 +00:00
|
|
|
package: $(pdf) $(html)
|
|
|
|
mkdir -p out/pdf
|
|
|
|
cp $(pdf) out/pdf/
|
|
|
|
mv out/pdf/out.pdf out/pdf/$(basename).pdf
|
|
|
|
|
|
|
|
mkdir -p out/html
|
|
|
|
cp $(html) out/html/
|
|
|
|
mv out/html/out.html out/html/$(basename).html
|
2016-11-23 21:48:44 +00:00
|
|
|
|
2017-10-24 12:46:06 +00:00
|
|
|
out.pdf : $(texsrc)
|
2016-11-10 14:13:26 +00:00
|
|
|
$(TEX) $(filter-out $<,$^ ) -o $@ --template=$< $(FLAGS)
|
|
|
|
|
2017-10-24 13:01:53 +00:00
|
|
|
|
|
|
|
out.html: $(htmlsrc)
|
|
|
|
$(PANDOC) handin.md -o $@ $(FLAGS)
|
|
|
|
|
|
|
|
|
2016-11-10 14:13:26 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean :
|
2017-10-24 12:46:06 +00:00
|
|
|
rm out.pdf
|
2017-10-24 13:01:53 +00:00
|
|
|
rm out.html
|
2017-10-24 12:46:06 +00:00
|
|
|
rm -R out
|