MARKDOWN_FILES = $(wildcard *.md) HTML_FILES = $(patsubst %.md, %.html, $(MARKDOWN_FILES)) PDF_FILES = $(patsubst %.md, %.pdf, $(MARKDOWN_FILES)) all: $(HTML_FILES) %.html: %.md cd $(dir $@) && gpp -H -DHTML=1 $(notdir $<) | pandoc --smart --standalone --self-contained -o $(notdir $@) -c ../style/comp150-sp17.css %.pdf: %.md cd $(dir $@) && gpp -H -DTEX=1 $(notdir $<) | pandoc --smart --standalone -o $(notdir $@) clean: rm -rf $(HTML_FILES) $(PDF_FILES)