sources = $(wildcard *.subplot) htmls = $(sources:.subplot=.html) pdfs = $(sources:.subplot=.pdf) .SUFFIXES: .subplot .html .pdf .subplot.html: subplot docgen --output $@ $< .subplot.pdf: subplot docgen --output $@ $< all: $(htmls) $(pdfs)