forked from visionmedia/masteringnode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (36 loc) · 853 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
41
42
43
44
45
46
PDF_FLAGS = --fontsize 9.0 \
--linkstyle plain \
--linkcolor green \
--embedfonts \
--footer "c 1" \
--no-toc
MD = pages/index.md \
chapters/installation.md \
chapters/modules.md \
chapters/globals.md \
chapters/events.md \
chapters/buffers.md \
chapters/streams.md \
chapters/fs.md \
chapters/tcp.md \
chapters/http.md \
chapters/connect.md \
chapters/express.md \
chapters/testing.md \
chapters/deploy.md
HTML = $(MD:.md=.html)
all: book.html book.pdf
book.pdf: $(HTML)
htmldoc $(HTML) $(PDF_FLAGS) --outfile $@
book.html: pages/head.html pages/tail.html $(HTML)
cat pages/head.html $(HTML) pages/tail.html > book.html
%.html: %.md
ronn --pipe --fragment $< \
| sed -E 's/<h1>([^ ]+) - /<h1>/' \
> $@
view: book.pdf
open book.pdf
clean:
rm -f book.*
rm -f chapters/*.html
.PHONY: view clean