-
Notifications
You must be signed in to change notification settings - Fork 63
/
Makefile
79 lines (67 loc) · 1.96 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.PHONY: default-target
default-target: build
###############################################################################
### User-settable variables
# List of documentation formats to generate.
DOCS = \
$(SPHINX_DOCS) \
pdf \
# end of DOCS
# Commands to run in the build process.
PDFLATEX = pdflatex
PYTHON = python
SPHINX_BUILD = sphinx-build
SPHINX_FLAGS =
# Options for above commands.
PDFLATEXOPTS =
SPHINXOPTS =
PYTHONOPTS =
SETUPPYOPTS =
###############################################################################
### Targets
# build: Build bayeslite.
.PHONY: build
build: setup.py
$(PYTHON) $(PYTHONOPTS) setup.py $(SETUPPYOPTS) build
# List of documentation formats we can generate with Sphinx. These
# should be the formats that have been tested and confirmed to yield
# reasonable output.
SPHINX_DOCS = \
html \
latex \
# end of SPHINX_DOCS
# doc: Build the bayeslite documentation.
.PHONY: doc
doc: $(DOCS)
.PHONY: $(SPHINX_DOCS)
$(SPHINX_DOCS): pythenv.sh build
rm -rf build/doc/$@ && \
rm -rf build/doc/[email protected] && \
./pythenv.sh $(SPHINX_BUILD) $(SPHINX_FLAGS) -b $@ doc \
build/doc/[email protected] && \
mv -f build/doc/[email protected] build/doc/$@
.PHONY: pdf
pdf: latex
rm -rf build/doc/$@ && \
rm -rf build/doc/[email protected] && \
mkdir build/doc/[email protected] && \
{ tar -C build/doc/latex -c -f - . \
| tar -C build/doc/[email protected] -x -f -; } && \
(cd build/doc/[email protected] && \
$(PDFLATEX) $(PDFLATEXOPTS) \\nonstopmode\\input bayeslite && \
$(PDFLATEX) $(PDFLATEXOPTS) \\nonstopmode\\input bayeslite && \
$(PDFLATEX) $(PDFLATEXOPTS) \\nonstopmode\\input bayeslite && \
$(MAKEINDEX) -s python.ist bayeslite.idx; \
$(PDFLATEX) $(PDFLATEXOPTS) \\nonstopmode\\input bayeslite && \
$(PDFLATEX) $(PDFLATEXOPTS) \\nonstopmode\\input bayeslite && \
:) && \
mv -f build/doc/[email protected] build/doc/$@
# check: (Build bayeslite and) run the tests.
.PHONY: check
check: check.sh
./check.sh
# clean: Remove build products.
.PHONY: clean
clean:
-rm -rf build
-rm -rf build/doc/*.tmp