blob: 62d3f3bd85d77e89881e03e18ca47afe5c11e996 [file] [log] [blame]
alshabibbfb8bb92017-02-15 12:48:33 -08001# Makefile to make it obvious what operations exist for this repo
2
3GITBOOK := node_modules/.bin/gitbook
4
5default: html
6
7help:
8 @echo "Available make targets:"
9 @echo " help - Print this help"
10 @echo " serve - Build gitbook static web pages and serve them locally"
11 @echo " html - Build gitbook static pages under _book dir"
12 @echo " pdf - Build gitbook pdf as book.pdf"
13 @echo
14 @echo "The following additional commands are used internally:"
15 @echo " check-gitbook - Check gitbook if gitbook is installed"
16 @echo " install-gitbook - Install the gitbook toolchain and plugins needed to build books"
17 @echo " prepare-gitbook - Make sure gitbook plugins are installed"
18
19check-gitbook:
20 @echo "Checking 'gitbook' installation..."
21 @if test -x $(GITBOOK) && $(GITBOOK) --version;\
22 then \
23 echo "Good. You have gitbook installed.";\
24 else \
25 echo "No gitbook execuatble found. Please run:";\
26 echo "";\
27 echo " make install-gitbook";\
28 echo "";\
29 echo "(You may be prompted for your password.)";\
30 echo "";\
31 fi
32
33install-gitbook:
34 @echo "Installing gitbook (may prompt for your password)..."
35 npm install
36 $(GITBOOK) install
37
38prepare-gitbook: check-gitbook
39 @echo "Checking 'gitbook' installation and do what's needed"
40 $(GITBOOK) init
41
42serve: prepare-gitbook
43 @echo "Continuous building and serving static web pages..."
44 $(GITBOOK) serve
45
46html: prepare-gitbook
47 @echo "Building static web pages..."
48 $(GITBOOK) build
49
50pdf: prepare-gitbook
51 @echo "Building PDF book..."
52 $(GITBOOK) pdf . VolthaMissingManual.pdf
53
54clean:
55 rm -rf _book
56 rm -rf VolthaMissingManual.pdf