MD=multimarkdown HDIR=html SRC = $(wildcard *.txt) OUT = $(patsubst %.txt,$(HDIR)/%.html,$(SRC)) all: $(OUT) # Done. $(HDIR): mkdir -p $(HDIR) $(HDIR)/%.html: %.txt $(HDIR) $(MD) $< > $@ .PHONY: clean clean: rm -f $(HDIR)/*.html rmdir $(HDIR)