xref: /petsc/doc/makefile (revision 73fdd05bb67e49f40fd8fd311695ff6fdf0b9b8a)
14754a72fSPatrick Sanan# Initially generated with sphinx-quickstart
24754a72fSPatrick Sanan
34754a72fSPatrick Sanan# You can set these variables from the command line, and also
44754a72fSPatrick Sanan# from the environment for the first two.
54754a72fSPatrick SananSPHINXOPTS    ?=
64754a72fSPatrick SananSPHINXBUILD   ?= sphinx-build
74754a72fSPatrick SananSOURCEDIR     = .
84754a72fSPatrick SananBUILDDIR      = _build
94754a72fSPatrick SananLINKCHECKDIR  = _build/linkcheck
104754a72fSPatrick Sanan
114754a72fSPatrick Sanan# First so that "make" without arguments is like "make help".
124754a72fSPatrick Sananhelp:
1386a7890dSBarry Smith	-@echo "   make sphinxhtml - build the HTML website inside a created Python virtual environment (venv)"
1486a7890dSBarry Smith
1586a7890dSBarry Smith# The following does not work because it triggers the loading of docutils that many people may not have in Python
1686a7890dSBarry Smith#	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
174754a72fSPatrick Sanan
184754a72fSPatrick Sanan.PHONY: help makefile checklinks
194754a72fSPatrick Sanan
2088932633SBarry Smithchecklinks_rule:
214754a72fSPatrick Sanan	@$(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(LINKCHECKDIR)" $(SPHINXOPTS)
224754a72fSPatrick Sanan	@echo
234754a72fSPatrick Sanan	@echo "Check finished. Report is in $(LINKCHECKDIR)."
244754a72fSPatrick Sanan
2588932633SBarry Smithchecklinks:
2688932633SBarry Smith	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
2788932633SBarry Smith
284754a72fSPatrick Sananclean-classic-docs:
294754a72fSPatrick Sanan	./build_classic_docs.py --clean
304754a72fSPatrick Sanan
314754a72fSPatrick Sananclean: clean-classic-docs
324754a72fSPatrick Sanan
334754a72fSPatrick Sananimages:
34*73fdd05bSBarry Smith	git clone https://gitlab.com/petsc/images.git -b main-2 --depth=1 images
354754a72fSPatrick Sanan
364754a72fSPatrick Sananwebsite-deploy: images
37a019710eSSatish Balay	$(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)"  -T -E -j auto $(SPHINXOPTS)
384754a72fSPatrick Sanan
3966c9fbddSBarry Smith# use this rule to build the documentation on your machine when working on PETSc documentation
40997fbc66SBarry Smithsphinxhtml:
41*73fdd05bSBarry Smith	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
42997fbc66SBarry Smith
434754a72fSPatrick Sanan# Catch-all target: route all unknown targets to Sphinx using the new
444754a72fSPatrick Sanan# "make mode" option.
454754a72fSPatrick Sanan%: makefile images
46a019710eSSatish Balay	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)"  -j auto $(SPHINXOPTS)
474754a72fSPatrick Sanan
48