src = $(wildcard *.md) posts = $(src:.md=.html) index.html: $(posts) blog_header.html blog_footer.html gen_index cat blog_header.html >$@ ./gen_index >>$@ cat blog_footer.html >>$@ %.html: %.md post_header.html post_footer.html cat post_header.html | sed "s/@TITLE@/`head -1 $< | sed 's/\//\\\\\//'`/" >$@ markdown $< >>$@ cat post_footer.html >>$@