Skip to content

Instantly share code, notes, and snippets.

@x2c3z4
Forked from lmullen/gist:3767386
Created June 18, 2013 12:13
Show Gist options
  • Save x2c3z4/5804859 to your computer and use it in GitHub Desktop.
Save x2c3z4/5804859 to your computer and use it in GitHub Desktop.
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | [email protected]
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
# source, and makes them using pandoc
%.md.pdf : %.md
pandoc $< -o $@
# Remove all PDF outputs
clean :
rm $(PDFS)
# Remove all PDF outputs then build them again
rebuild : clean all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment