1# Initially generated with sphinx-quickstart 2 3# You can set these variables from the command line, and also 4# from the environment for the first two. 5SPHINXOPTS ?= 6SPHINXBUILD ?= sphinx-build 7SOURCEDIR = . 8BUILDDIR = _build 9LINKCHECKDIR = _build/linkcheck 10 11# First so that "make" without arguments is like "make help". 12help: 13 -@echo " make sphinxhtml - build the HTML website inside a created Python virtual environment (venv)" 14 15# The following does not work because it triggers the loading of docutils that many people may not have in Python 16# @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) 17 18.PHONY: help makefile checklinks 19 20checklinks_rule: 21 @$(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(LINKCHECKDIR)" $(SPHINXOPTS) 22 @echo 23 @echo "Check finished. Report is in $(LINKCHECKDIR)." 24 25checklinks: 26 cd .. ; python3 -m venv petsc-doc-env ; source petsc-doc-env/bin/activate ; python3 -m pip install -r doc/requirements.txt ; cd doc ; make checklinks_rule; deactivate 27 28clean-classic-docs: 29 ./build_classic_docs.py --clean 30 31clean: clean-classic-docs 32 33images: 34 git clone https://gitlab.com/petsc/images.git -b main-2 --depth=1 images 35 36website-deploy: images 37 $(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -T -E -j auto $(SPHINXOPTS) 38 39# use this rule to build the documentation on your machine when working on PETSc documentation 40sphinxhtml: 41 cd .. ; python3 -m venv petsc-doc-env ; source petsc-doc-env/bin/activate ; python3 -m pip install -r doc/requirements.txt ; cd doc ; ${RM} -rf _build* manualpages/singlindex.md manualpages/*/*.md; make SPHINXOPTS="-T -E -W --keep-going -j 4" html; deactivate 42 43# Catch-all target: route all unknown targets to Sphinx using the new 44# "make mode" option. 45%: makefile images 46 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" -j auto $(SPHINXOPTS) 47 48