TEX = pandoc texsrc = template.tex handin.md src = out.pdf FLAGS = --latex-engine=pdflatex pdfname = $(shell basename $(CURDIR)).pdf package: $(src) mkdir -p out cp $(src) out/ mv out/out.pdf out/$(pdfname) out.pdf : $(texsrc) $(TEX) $(filter-out $<,$^ ) -o $@ --template=$< $(FLAGS) .PHONY: clean clean : rm out.pdf rm -R out