-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (41 loc) · 1.81 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
TITLE=wsrte
TEMPLATE_PATH:=./templates
HTML_FLAGS:=-s --toc --template=$(TEMPLATE_PATH)/c-atre.html5 -t html5
HTML_FLAGS+=--css=$(TEMPLATE_PATH)/data/html.css
EPUB_FLAGS:=--toc --template=$(TEMPLATE_PATH)/c-atre.epub3 -t epub3
EPUB_FLAGS+=--epub-stylesheet=$(TEMPLATE_PATH)/data/epub.css
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/montserrat/fonts/otf/Montserrat-Regular.otf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/montserrat/fonts/otf/Montserrat-Italic.otf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/montserrat/fonts/otf/Montserrat-Bold.otf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/montserrat/fonts/otf/Montserrat-BoldItalic.otf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/arvo/Arvo-Regular_201.ttf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/arvo/Arvo-Italic_201.ttf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/arvo/Arvo-Bold_201.ttf
EPUB_FLAGS+=--epub-embed-font=$(TEMPLATE_PATH)/fonts/arvo/Arvo-BoldItalic_201.ttf
ODT_FLAGS:=--toc --template=$(TEMPLATE_PATH)/c-atre.opendocument
ODT_FLAGS+=--data-dir=$(TEMPLATE_PATH)/data
PDF_FLAGS:=--toc --template=$(TEMPLATE_PATH)/c-atre.latex
PDF_FLAGS+=--latex-engine=xelatex -V template-path:$(TEMPLATE_PATH)/
.PHONY: dep all html epub mobi odt pdf
all: html epub mobi odt pdf
dep:
@git submodule update --init --recursive --depth 1
html: $(TITLE).html
epub: $(TITLE).epub
mobi: $(TITLE).mobi
odt: $(TITLE).odt
pdf: $(TITLE).pdf
%.html: %.md dep
pandoc $(HTML_FLAGS) "$<" -o "$@"
%.epub: %.md dep
pandoc $(EPUB_FLAGS) "$<" -o "$@"
%.mobi: %.epub dep
ebook-convert "$<" "$@"
%.odt: %.md dep
pandoc $(ODT_FLAGS) "$<" -o "$@"
%.pdf: %.md dep
pandoc $(PDF_FLAGS) "$<" -o "$@"
clean:
rm -f $(TITLE).epub $(TITLE).html $(TITLE).mobi $(TITLE).pdf $(TITLE).odt
dist:
tar -czf $(TITLE).tar.gz Makefile LICENSE $(TITLE).md