markdown-template/Makefile

20 lines
322 B
Makefile

PDFDIR = pdf
SRCDIR = src
PANDOC = pandoc
PANDOCFLAGS =
SRCS = $(shell find $(SRCDIR) -type f -iname '*.md')
PDFS = $(patsubst $(SRCDIR)/%.md,$(PDFDIR)/%.pdf,$(SRCS))
.PHONY: all
all: $(PDFS)
.PHONY: clean
clean:
$(RM) -r $(PDFDIR)
$(PDFDIR)/%.pdf: $(SRCDIR)/%.md
@mkdir -p $(@D)
$(PANDOC) $(PANDOCFLAGS) $< -o $@