.SUFFIXES: notes := $(wildcard *.md) all: $(patsubst %.md,public_html/%.html,$(notes)) PANDOCFLAGS := --data-dir pandoc BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$* public_html/%.html: %.md pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml -o $@ $< public_html/%.html.part: %.md pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $< public_html/%.html.d: %.md pandoc lua dependencies.lua $< > $@ include $(patsubst %.md,public_html/%.html.d,$(notes)) # include dependencies.mk # # dependencies.mk: $(wildcard *.md) # pandoc lua pandoc/dependencies.lua index.md $@ # # PANDOCFLAGS := --data-dir pandoc # BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$* # # public_html/%.html: parts = $(filter-out $<,$^) # public_html/%.html: %.md | dependencies.mk # pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml $(patsubst %,-M parts=%,$(parts)) -o $@ $< # # public_html/%.html.part: %.md # pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $< clean: $(RM) public_html/*.html $(RM) public_html/*.html.part $(RM) public_html/*.html.d $(RM) -r dest .PHONY: all findbroken clean dest/%.docx: %.md test -d dest || mkdir dest pandoc $(PANDOCFLAGS) -d docx.yaml -o $@ $<