MD = $(shell find md/ -type f -name '*.md') INC = $(shell find md/ -type f -name '*.inc') HTML_PAGE = $(patsubst md/%.md, html/%.html, $(MD)) HTML_INCL = $(patsubst md/%.inc, html/%.html, $(INC)) .PHONY: all all: $(HTML_PAGE) html/%.html: md/%.md @mkdir -p "$(@D)" @pandoc "$<" -s -o "$@" clean: @rm -rf html/