Add single book Makefile

master
subnixr 2017-06-04 14:26:13 +02:00
parent 0a7fae10a4
commit 75465bec99
3 changed files with 20 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
pdf/
*.pdf

17
Makefile.book 100644
View File

@ -0,0 +1,17 @@
TARGET = book.pdf
SRCDIR = src
PANDOC = pandoc
PFLAGS =
SRCS = $(sort $(wildcard $(SRCDIR)/*.md))
.PHONY: all
all: $(TARGET)
.PHONY: clean
clean:
$(RM) -r $(TARGET)
$(TARGET): $(SRCS)
$(PANDOC) $(PFLAGS) $^ -o $@

View File

@ -2,7 +2,7 @@ PDFDIR = pdf
SRCDIR = src
PANDOC = pandoc
PANDOCFLAGS = -f markdown -t latex
PFLAGS =
SRCS = $(shell find $(SRCDIR) -type f -iname '*.md')
PDFS = $(patsubst $(SRCDIR)/%.md,$(PDFDIR)/%.pdf,$(SRCS))
@ -16,4 +16,4 @@ clean:
$(PDFDIR)/%.pdf: $(SRCDIR)/%.md
@mkdir -p $(@D)
$(PANDOC) $(PANDOCFLAGS) $< -o $@
$(PANDOC) $(PFLAGS) $< -o $@