2020-09-10 13:25:58 -04:00
|
|
|
# make-env setup -------------------------------------------------------------
|
|
|
|
|
|
|
|
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
# A pip `requirements.txt` file.
|
2022-02-14 16:05:13 -05:00
|
|
|
REQUIREMENTS_FILE := docs/requirements.txt
|
2022-02-09 21:23:29 -05:00
|
|
|
|
2020-09-10 13:25:58 -04:00
|
|
|
# A conda `environment.yml` file.
|
|
|
|
ENVIRONMENT_FILE := environment.yml
|
|
|
|
|
|
|
|
include third_party/make-env/conda.mk
|
|
|
|
|
|
|
|
# Makefile for Sphinx documentation ------------------------------------------
|
2019-04-05 10:56:47 -04:00
|
|
|
|
|
|
|
# You can set these variables from the command line.
|
|
|
|
SPHINXOPTS =
|
2020-02-25 08:52:51 -05:00
|
|
|
SPHINXBUILD = sphinx-build
|
2019-04-05 10:56:47 -04:00
|
|
|
PAPER =
|
2022-02-09 21:19:21 -05:00
|
|
|
BUILDDIR = _build
|
2019-04-05 10:56:47 -04:00
|
|
|
|
|
|
|
# Internal variables.
|
|
|
|
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
|
|
PAPEROPT_letter = -D latex_paper_size=letter
|
2022-02-14 16:05:13 -05:00
|
|
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) docs
|
2019-04-05 10:56:47 -04:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo " html to make standalone HTML files"
|
|
|
|
@echo " dirhtml to make HTML files named index.html in directories"
|
|
|
|
@echo " singlehtml to make a single large HTML file"
|
|
|
|
@echo " pickle to make pickle files"
|
|
|
|
@echo " json to make JSON files"
|
|
|
|
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
|
|
@echo " epub to make an epub"
|
|
|
|
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
|
|
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
|
|
@echo " text to make text files"
|
|
|
|
@echo " man to make manual pages"
|
|
|
|
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
|
|
@echo " linkcheck to check all external links for integrity"
|
|
|
|
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
2019-10-15 09:39:16 -04:00
|
|
|
@echo " env to create a conda environment with the needed packages"
|
2019-04-05 10:56:47 -04:00
|
|
|
|
2020-09-10 13:25:58 -04:00
|
|
|
clean::
|
2020-02-25 08:46:16 -05:00
|
|
|
-rm -rf $(BUILDDIR)/
|
2019-04-05 10:56:47 -04:00
|
|
|
|
|
|
|
latex:
|
|
|
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
|
|
sed -i 's/PDFLATEX = pdflatex/PDFLATEX = texfot pdflatex/' $(BUILDDIR)/latex/Makefile
|
|
|
|
@echo
|
|
|
|
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
|
|
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
|
|
|
"(use \`make latexpdf' here to do that automatically)."
|
|
|
|
|
|
|
|
latexpdf:
|
|
|
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
|
|
sed -i 's/PDFLATEX = pdflatex/PDFLATEX = texfot pdflatex/' $(BUILDDIR)/latex/Makefile
|
|
|
|
@echo "Running LaTeX files through pdflatex..."
|
|
|
|
make -C $(BUILDDIR)/latex all-pdf
|
|
|
|
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
|
|
|
2022-02-09 21:23:29 -05:00
|
|
|
%:
|
|
|
|
$(SPHINXBUILD) -b $@ $(ALLSPHINXOPTS) $(BUILDDIR)/$@
|