-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
66 lines (42 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Source md filenames, excluding macros.md and slides_header.md
SOURCE_MD = $(filter-out macros.md slides_header.md, $(wildcard *.md))
# Source mdw filenames
SOURCE_MDW = $(wildcard *.mdw)
# Exported md filenames
EXPORTED_DOCS_MD = $(SOURCE_MDW:.mdw=.md)
# Exported pdf filenames
EXPORTED_DOCS_PDF = $(SOURCE_MD:.md=.pdf)
# Exported odt filenames
EXPORTED_DOCS_ODT = $(SOURCE_MD:.md=.odt)
# Exported tex filenames
EXPORTED_DOCS_TEX = $(SOURCE_MD:.md=.tex)
# Pandoc options
PANDOC = pandoc
PANDOC_OPTIONS = -f markdown+latex_macros --standalone
# PWeave options
PWEAVE = pweave
PWEAVE_OPTIONS = -f pandoc
# Other options
RM=/bin/rm
# Make Rules
%.pdf : %.md
$(PANDOC) $(PANDOC_OPTIONS) -o $@ $<
%.odt : %.md
$(PANDOC) $(PANDOC_OPTIONS) -o $@ $<
%.tex : %.md
$(PANDOC) $(PANDOC_OPTIONS) -o $@ $<
%.md : %.mdw
$(PWEAVE) $(PWEAVE_OPTIONS) -o $@ $<
# What is this?
.PHONY: all clean
all : pdf
debug: tex odt pdf
odt : $(EXPORTED_DOCS_ODT)
pdf : $(EXPORTED_DOCS_PDF)
tex : $(EXPORTED_DOCS_TEX)
md : $(EXPORTED_DOCS_MD)
clean:
- $(RM) $(EXPORTED_DOCS_PDF)
- $(RM) $(EXPORTED_DOCS_ODT)
- $(RM) $(EXPORTED_DOCS_TEX)
- $(RM) $(EXPORTED_DOCS_MD)