aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: f3fc47fa7ff9869f0a45923cb2eded2b61819be7 (plain)
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
.POSIX:
.SUFFIXES:

# commands
GIT = git
SPHINXBUILD = sphinx-build
SPHINXOPTS =
SPHINXDEFVER = -D release="$$($(GIT) describe --tags --exact-match 2>/dev/null || $(GIT) log -1 --no-decorate --oneline)"
SPHINXFULLOPTS = $(SPHINXDEFVER) $(SPHINXOPTS)
SOURCEDIR = .
BUILDDIR = _build
PDFINFO = pdfinfo

all: html pdf epub gmi

html: Makefile
	@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXFULLOPTS)

gmi: Makefile
	@$(SPHINXBUILD) -M gmi "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXFULLOPTS)

pdf: Makefile
	@$(SPHINXBUILD) -M rinoh "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXFULLOPTS)

epub: Makefile
	@$(SPHINXBUILD) -M epub "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXFULLOPTS)

clean:
	rm -rf _build/*

check: pdf
	test $$($(PDFINFO) _build/rinoh/crowbar-spec.pdf | grep Pages | awk '{ print $$2 }') -le 200