forked from sdogruyol/crystal_for_rubyists
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (42 loc) · 1.47 KB
/
Makefile
File metadata and controls
61 lines (42 loc) · 1.47 KB
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
CHAPTERS=book/preamble.md \
$(sort $(wildcard book/chapter-*.md))
CONTENTS=book/title.txt \
$(CHAPTERS)
ALL_FILES=$(CHAPTERS) \
book/metadata.xml \
book/title.txt \
cover.png
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 %.md,%.html,$(wildcard book/chapter-*.md)) \
book/book.html \
crystal-for-rubyists.epub \
crystal-for-rubyists.pdf \
crystal-for-rubyists.mobi \
*.tgz
all: crystal-for-rubyists-epub.tgz crystal-for-rubyists-pdf.tgz crystal-for-rubyists-mobi.tgz site
crystal-for-rubyists.epub: $(ALL_FILES)
pandoc $(EPUB_OPTS) -o $@ $(CONTENTS)
crystal-for-rubyists.pdf: $(ALL_FILES)
pandoc $(EPUB_OPTS) -o $@ $(CONTENTS)
crystal-for-rubyists.mobi: crystal-for-rubyists.epub
kindlegen crystal-for-rubyists.epub
book/book.html: $(CHAPTERS)
pandoc -o $@ $(HTML_OPTS) $(CHAPTERS)
book/%.html : book/%.md
pandoc -o $@ $(HTML_OPTS) $<
site: $(patsubst %.md,%.html,$(wildcard book/chapter-*.md)) book/book.html
code.tgz: code
tar cf code.tgz code
crystal-for-rubyists-epub.tgz: crystal-for-rubyists.epub code.tgz
tar cf $@ $< code.tgz
crystal-for-rubyists-pdf.tgz: crystal-for-rubyists.pdf code.tgz
tar cf $@ $< code.tgz
crystal-for-rubyists-mobi.tgz: crystal-for-rubyists.mobi code.tgz
tar cf $@ $< code.tgz
ship: all
git push origin
bundle exec s3deploy
.PHONY: clean
clean:
rm -f $(CLEAN_FILES)