-
Notifications
You must be signed in to change notification settings - Fork 148
/
Makefile
41 lines (32 loc) · 1012 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Generate PDFs from the Markdown source files
#
# In order to use this makefile, you need some tools:
# - GNU make
# - Pandoc
# - LuaLaTeX
# - DejaVu Sans fonts
# Directory containing source (Markdown) files
source := docs
# Directory containing pdf files
output := print
# All markdown files in src/ are considered sources
sources := $(wildcard $(source)/*.md)
# Convert the list of source files (Markdown files in directory src/)
# into a list of output files (PDFs in directory print/).
objects := $(patsubst %.md,%.pdf,$(subst $(source),$(output),$(sources)))
all: $(objects)
# Recipe for converting a Markdown file into PDF using Pandoc
$(output)/%.pdf: $(source)/%.md
pandoc --variable mainfont="DejaVu Sans" \
--variable monofont="DejaVu Sans Mono" \
--variable fontsize=11pt \
--variable geometry:margin=1.5cm \
--variable geometry:a4paper \
--table-of-contents \
--number-sections \
-f markdown $< \
--latex-engine=lualatex \
-o $@
.PHONY : clean
clean:
rm -f $(output)/*