sections = $(shell find sections/ -name '*.md' | sort -V) pandoc = \ @ pandoc $(1) \ --toc \ --standalone \ --pdf-engine=xelatex \ -F pandoc-crossref \ -F pandoc-citeproc \ -o $(2).pdf all: exercises.pdf clean: rm exercises.pdf exercises.pdf: $(sections) images $(call pandoc, $(sections), exercises)