-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 1.21 KB
/
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
#------------------------------------------------------------------------------#
# Declare variables. #
#------------------------------------------------------------------------------#
MMD = multimarkdown
LATEX = pdflatex
MMDS = $(wildcard *.mmd)
PDFS = $(MMDS:%.mmd=%.pdf)
#------------------------------------------------------------------------------#
# Make the high level targets. #
#------------------------------------------------------------------------------#
.PHONY: all clean
all: $(PDFS)
%.tex: .%.mmd
$(MMD) -t latex -o $@ -- $<
.%.mmd: %.mmd mmd/preamble.mmd
if [[ -f "mmd/user.mmd" ]]; then \
cat -- "mmd/preamble.mmd" "mmd/user.mmd" $< > $@; \
else \
cat -- "mmd/preamble.mmd" $< > $@; \
fi
%.pdf: %.tex
TEXMFHOME=".$${TEXMFHOME:+":$${TEXMFHOME}"}" $(LATEX) -- $<
#------------------------------------------------------------------------------#
# Clean the distribution. #
#------------------------------------------------------------------------------#
clean:
rm -rf -- $(MMDS) $(PDFS) \
*.aux *.bbl *.blg *.glo *.idx *.ist *.log *.out *.toc