forked from karlseguin/the-little-redis-book
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (29 loc) · 906 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
SOURCE_FILE_NAME = redis.md
BOOK_FILE_NAME = redis
PDF_BUILDER = pandoc
PDF_BUILDER_FLAGS = \
--latex-engine xelatex \
--template ../common/pdf-template.tex \
--listings \
--toc
EPUB_BUILDER = pandoc
EPUB_BUILDER_FLAGS = \
--toc \
--epub-cover-image \
MOBI_BUILDER = kindlegen
en/redis.pdf:
cd en && $(PDF_BUILDER) $(PDF_BUILDER_FLAGS) $(SOURCE_FILE_NAME) -o $(BOOK_FILE_NAME).pdf
en/redis.epub: en/title.png en/title.txt en/redis.md
$(EPUB_BUILDER) $(EPUB_BUILDER_FLAGS) $^ -o $@
en/redis.mobi: en/redis.epub
$(MOBI_BUILDER) $^
fr/redis.pdf:
cd fr && $(PDF_BUILDER) $(PDF_BUILDER_FLAGS) $(SOURCE_FILE_NAME) -o $(BOOK_FILE_NAME).pdf
fr/redis.epub: fr/title.png fr/title.txt fr/redis.md
$(EPUB_BUILDER) $(EPUB_BUILDER_FLAGS) $^ -o $@
fr/redis.mobi: fr/redis.epub
$(MOBI_BUILDER) $^
clean:
rm -f */$(BOOK_FILE_NAME).pdf
rm -f */$(BOOK_FILE_NAME).epub
rm -f */$(BOOK_FILE_NAME).mobi