forked from canonical/netplan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (51 loc) · 1.97 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
# Minimal makefile for Sphinx documentation
# This is for development purposes only, e.g. to run a local Sphinx
# development environment. Usage:
#
# Setup: Run `make install` from doc/ to setup a Python virtual env
# Devel: Run `make run` from doc/ to get a live preview of your changes
# Test: Run `make spelling` from doc/ to validate your spelling
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
VENV = env/bin/activate
PORT = 8090
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
install:
@echo "... setting up virtualenv"
python3 -m venv env
. $(VENV); pip install --upgrade -r requirements.txt
@echo "\n" \
"--------------------------------------------------------------- \n" \
"* watch, build and serve the documentation: make run \n" \
"* check spelling: make spelling \n" \
"\n" \
"enchant must be installed in order for pyenchant (and therefore \n" \
"spelling checks) to work. \n" \
"--------------------------------------------------------------- \n"
clean:
-rm -rf _build/*
run:
. $(VENV); sphinx-autobuild $(ALLSPHINXOPTS) --ignore ".git/*" --ignore "*.scss" . -b dirhtml -a _build/html --host 0.0.0.0 --port $(PORT)
test:
. $(VENV); $(SPHINXBUILD) -b html . _build/html
html:
. $(VENV); $(SPHINXBUILD) -b dirhtml . _build/html
spelling:
. $(VENV); $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) . _build/spelling
@echo
@echo "Check finished. Wrong words can be found in " \
"_build/spelling/output.txt."
quickstart:
. $(VENV); sphinx-quickstart
.PHONY: help install clean run Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)