xref: /petsc/doc/makefile (revision 66af8762ec03dbef0e079729eb2a1734a35ed7ff)
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 .. ; ${RM} -rf petsc-doc-env; 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:
29	-@${RM} -rf _build __pycache__
30
31images:
32	git clone https://gitlab.com/petsc/images.git -b main-2 --depth=1 images
33
34website-deploy: images
35	$(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)"  -T -E -j auto $(SPHINXOPTS)
36
37# use this rule to build the documentation on your machine when working on PETSc documentation
38sphinxhtml:
39	cd .. ; python3 -m venv petsc-doc-env ; source petsc-doc-env/bin/activate ; python3 -m pip install --quiet -r doc/requirements.txt ; cd doc ; ${RM} -rf _build* manualpages/singlindex.md  manualpages/*/*.md; make  SPHINXOPTS="-T -E -W --keep-going -j 8" html; deactivate
40
41sphinxpdf:
42	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  latexpdf; deactivate
43
44# Catch-all target: route all unknown targets to Sphinx using the new
45# "make mode" option.
46%: makefile images
47	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)"  -j auto $(SPHINXOPTS)
48
49