Skip to content
Browse files

Add Makefile for books building.

The same thing as for The Little MongoDB book.
  • Loading branch information...
1 parent 886e2c2 commit f945d909e4eaa0016bb9307fe1cff3488fdc2ce1 @ming13 ming13 committed Nov 23, 2012
Showing with 29 additions and 0 deletions.
  1. +29 −0 Makefile
View
29 Makefile
@@ -0,0 +1,29 @@
+SOURCE_FILE_NAME = redis.md
+BOOK_FILE_NAME = redis
+
+PDF_BUILDER = pandoc
+PDF_BUILDER_FLAGS = \
+ --latex-engine xelatex \
+ --template ../common/pdf-template.tex \
+ --listings
+
+EPUB_BUILDER = pandoc
+EPUB_BUILDER_FLAGS = \
+ --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) $^
+
+clean:
+ rm -f */$(BOOK_FILE_NAME).pdf
+ rm -f */$(BOOK_FILE_NAME).epub
+ rm -f */$(BOOK_FILE_NAME).mobi

0 comments on commit f945d90

Please sign in to comment.
Something went wrong with that request. Please try again.