aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 432029b3afc4c5291517285323e09c5e255ac068 (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 version="$$($(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/crowbarlanguage.pdf | grep Pages | awk '{ print $$2 }') -le 200