BUILDDIR ?= build PAGE := $(shell basename $(shell pwd)) PREFIX := $(BUILDDIR)/page/$(PAGE) MARKDOWN_FILES := $(wildcard *.md) MARKDOWN_TARGETS = $(patsubst %.md,$(PREFIX)/%.html,$(MARKDOWN_FILES)) all: $(MARKDOWN_TARGETS) index $(PREFIX)/%.html: %.md @mkdir -p $(@D) pandoc $< --to html --output $@ --standalone $(PREFIX)/index.html: @mkdir -p $(@D) ./generate_index.sh > $@ index: $(PREFIX)/index.html .PHONY: all index