Skip to content

Instantly share code, notes, and snippets.

Created Mar 10, 2016
What would you like to do?
Modified makefile for 10.11 el capitan users.
CHAPTERS=book/ \
$(sort $(wildcard book/chapter-*.md))
CONTENTS=book/title.txt \
book/metadata.xml \
book/title.txt \
EPUB_OPTS=--toc --smart --epub-cover-image=cover.png --epub-metadata=book/metadata.xml
HTML_OPTS=--smart --to=html5 --template=book/template.html
CLEAN_FILES=$(patsubst,%.html,$(wildcard book/chapter-*.md)) \
rust-for-rubyists.epub \
rust-for-rubyists.pdf \ \
all: rust-for-rubyists-epub.tgz rust-for-rubyists-pdf.tgz rust-for-rubyists-mobi.tgz site
rust-for-rubyists.epub: $(ALL_FILES)
pandoc --latex-engine=/Library/TeX/Root/bin/x86_64-darwin/pdflatex $(EPUB_OPTS) -o $@ $(CONTENTS)
rust-for-rubyists.pdf: $(ALL_FILES)
pandoc --latex-engine=/Library/TeX/Root/bin/x86_64-darwin/pdflatex $(EPUB_OPTS) -o $@ $(CONTENTS) rust-for-rubyists.epub
kindlegen rust-for-rubyists.epub
book/book.html: $(CHAPTERS)
pandoc --latex-engine=/Library/TeX/Root/bin/x86_64-darwin/pdflatex -o $@ $(HTML_OPTS) $(CHAPTERS)
book/%.html : book/
pandoc --latex-engine=/Library/TeX/Root/bin/x86_64-darwin/pdflatex -o $@ $(HTML_OPTS) $<
site: $(patsubst,%.html,$(wildcard book/chapter-*.md)) book/book.html
code.tgz: code
tar cf code.tgz code
rust-for-rubyists-epub.tgz: rust-for-rubyists.epub code.tgz
tar cf $@ $< code.tgz
rust-for-rubyists-pdf.tgz: rust-for-rubyists.pdf code.tgz
tar cf $@ $< code.tgz
rust-for-rubyists-mobi.tgz: code.tgz
tar cf $@ $< code.tgz
ship: all
git push origin
.PHONY: clean
rm -f $(CLEAN_FILES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment