Skip to content
Makefile 842 B
Newer Older
TiG's avatar
TiG committed
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
VIRTUAL_ENV   ?= .venv
TiG's avatar
TiG committed
SPHINXOPTS    ?=
SPHINXBUILD   ?= $(VIRTUAL_ENV)/bin/sphinx-build
TiG's avatar
TiG committed
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
TiG's avatar
TiG committed
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile venv
TiG's avatar
TiG committed

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile venv
TiG's avatar
TiG committed
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

venv:
	@if [ ! -d "$(VIRTUAL_ENV)" ]; \
	then python3 -m venv "$(VIRTUAL_ENV)"; \
Bengfort's avatar
Bengfort committed
	$(VIRTUAL_ENV)/bin/pip3 install sphinx sphinx-rtd-theme; \