-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (30 loc) · 1.07 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
.PHONY: all html book latex odt clean watch plant
PATH := $(PATH):/c/dev/pandoc
get_md = find src/ -name "*.md" -not -name "todo-*"
mdfiles := $(shell $(get_md) | sort)
plantfiles := $(shell find . -name "*.plantuml")
set_mod = sed -i "s/{{modified}}/$(shell date -d @$(shell $(get_md) -exec date -r {} +'%s' \; | sort -nr | head -1) +'%B %e, %Y')/g" $@
converted/basis.html: $(mdfiles)
pandoc -f markdown+yaml_metadata_block --toc -s -o $@ $^
$(set_mod)
converted/basis.epub: $(mdfiles)
pandoc -f markdown+yaml_metadata_block --toc -o $@ $^
$(set_mod)
converted/basis.tex: $(mdfiles)
pandoc -f markdown+yaml_metadata_block -s -o $@ $^
$(set_mod)
converted/basis.odt: $(mdfiles)
pandoc -f markdown+yaml_metadata_block -s -o $@ $^
$(set_mod)
converted/protocol.png: $(plantfiles)
plantuml protocol.plantuml -o $(dir $@) -tpng
all: html
html: converted/basis.html
book: converted/basis.epub
latex: converted/basis.tex
odt: converted/basis.odt
plant: converted/protocol.png
clean:
rm -rf converted/*
watch:
while true; do inotifywait -qr -e close_write src/; make; done