.SUFFIXES: notes := $(wildcard *.md) pages := $(patsubst %.md,public_html/%.html,$(notes)) static := public_html/index.html all: $(pages) BAVBAVHAUSFLAGS:= --data-dir pandoc -d bavbavhaus.net.yaml public_html/%.html: %.md pandoc $(BAVBAVHAUSFLAGS) -o $@ $< $(pages): pandoc/templates/bavbavhaus.net.html5 clean: oldpages := $(filter-out $(static) $(pages),$(wildcard public_html/*.html)) clean: $(if $(oldpages),$(RM) $(oldpages)) .PHONY: all clean dest/%.docx: %.md test -d dest || mkdir dest pandoc $(PANDOCFLAGS) -d docx.yaml -o $@ $<