-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (27 loc) · 871 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
PROJECT = blogpost
REFERENCES = references.bib
FIGSDIR = figs
FIGURES := $(wildcard $(FIGSDIR)/*)
OUTDIR = _build
.PHONY: pdf docx html clean show serve figures
pdf: $(OUTDIR)/$(PROJECT).pdf
docx: $(OUTDIR)/$(PROJECT).docx
html: $(OUTDIR)/index.html
clean:
rm -rf $(OUTDIR)
show: $(OUTDIR)/$(PROJECT).pdf
xdg-open $<
serve: html
python serve.py
figures: $(FIGURES) | $(OUTDIR)/$(FIGSDIR)
cp -r $^ $(OUTDIR)/$(FIGSDIR)
$(OUTDIR)/$(PROJECT).pdf: $(PROJECT).md | $(OUTDIR) $(REFERENCES)
pandoc -s --bibliography $(REFERENCES) --citeproc -o $@ $<
$(OUTDIR)/$(PROJECT).docx: $(PROJECT).md | $(OUTDIR) $(REFERENCES)
pandoc -s --bibliography $(REFERENCES) --citeproc -o $@ $<
$(OUTDIR)/index.html: $(PROJECT).md | $(OUTDIR) $(REFERENCES) figures
pandoc -s --bibliography $(REFERENCES) --citeproc -o $@ $<
$(OUTDIR):
mkdir $@
$(OUTDIR)/$(FIGSDIR):
mkdir $@