-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
49 lines (39 loc) · 1.66 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
# Build the pyvsc documentation
#
# Note: this Makefile is *not* used by Read The Docs, it exec()'s the conf.py
# file directly. Hence, all special build steps here are only relevant for
# local builds, not for RTD builds. Add all build steps which should be executed
# in RTD builds as Python code into the conf.py file.
DOC_DIR=$(dir $(dirname $(MAKEFILE_LIST)))
VSC_DIR=$(abspath $(DOC_DIR)/..)
PATH:=$(VSC_DIR)/packages/python/bin:$(PATH)
export PATH
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = .venv.bld/bin/sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help: .venv.bld
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.venv.bld: requirements.txt
@echo Creating Python venv for Sphinx build
python3 -m venv .venv.bld
.venv.bld/bin/pip -q install --upgrade pip
.venv.bld/bin/pip -q install -r requirements.txt
@touch .venv.bld
.PHONY: clean
clean: .venv.bld Makefile
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: distclean
distclean:
-rm -rf .venv* build sphinxext/__pycache__
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
.DEFAULT:
# Dependencies for this special target are ignored by make, as discussed in
# http://stackoverflow.com/questions/26875072/dependencies-for-special-make-target-default-not-firing
# We hack around that by calling the target explicitly.
make .venv.bld
source .venv.bld/bin/activate; $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)