-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (38 loc) · 1.46 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
#### Generated image files ####
DOT_GEN_FILES = $(patsubst %.dot, %.png, $(wildcard dot/*.dot))
SVG_GEN_FILES = $(patsubst %.svg, %.png, $(wildcard svg/*.svg))
MSC_GEN_FILES = $(patsubst %.msc, %.png, $(wildcard msc/*.msc))
ALL_GEN_FILES = ${DOT_GEN_FILES} ${SVG_GEN_FILES} ${MSC_GEN_FILES}
#### Primary targets ####
TARGETS = report.html report.pdf
default: $(TARGETS)
clean:
rm -f $(TARGETS) $(ALL_GEN_FILES)
#### Use pandoc to create PDF and HTML ####
report.html: report.md template_pandoc.html markdown.css Makefile $(ALL_GEN_FILES)
pandoc report.md -s --toc --toc-depth=5 --number-sections \
--metadata date="`date +%m/%d/%y`" \
-f markdown+yaml_metadata_block+startnum \
--filter pandoc-fignos \
--template template_pandoc.html \
--css=markdown.css \
-o report.html
report.pdf: report.md template_pandoc.latex Makefile $(ALL_GEN_FILES)
pandoc report.md -s --toc --toc-depth=5 --number-sections \
--metadata date="`date +%m/%d/%y`" \
-f markdown+yaml_metadata_block+startnum \
--filter pandoc-fignos \
--template template_pandoc.latex \
-V colorlinks \
--highlight-style=monochrome \
-o report.pdf
#### Wildcard rules for generating PNGs from source formats ####
dot/%.png: dot/%.dot Makefile
mkdir -p img/dot
dot -Tpng -o ./img/$@ $<
msc/%.png: msc/%.msc Makefile
mkdir -p img/msc
mscgen -T png -i $< -o ./img/$@
svg/%.png: svg/%.svg Makefile
mkdir -p img/svg
inkscape -z -e ./img/$@ $<