BOOKS = inclusion FORMATS = html txt # Default format in case a book target is called without FORMAT=* FORMAT = html all: $(FORMATS) books: $(BOOKS) $(FORMATS): @make 'FORMAT=$@' books $(BOOKS): @printf ' RENDER %s as %s\n' '$@' '$(FORMAT)' @PERL5LIB=scripts scripts/markdownbook.pl $(FORMAT) 'policies/$@' clean: @for book in $(BOOKS); do \ printf ' CLEAN %s\n' "$${book}"; \ rm -f "policies/$${book}/"*.html; \ rm -f "policies/$${book}/"*.txt; \ done