39 lines
1.2 KiB
Makefile
39 lines
1.2 KiB
Makefile
|
|
||
|
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
||
|
REQUIREMENTS_FILE := requirements.txt
|
||
|
ENVIRONMENT_FILE := environment.yml
|
||
|
|
||
|
include ../third_party/make-env/conda.mk
|
||
|
|
||
|
# NOTE: make env to create a conda environment with the needed packages
|
||
|
|
||
|
SPHINXOPTS =
|
||
|
SPHINXBUILD = sphinx-build
|
||
|
PAPER =
|
||
|
BUILDDIR = _build
|
||
|
|
||
|
PAPEROPT_a4 = -D latex_paper_size=a4
|
||
|
PAPEROPT_letter = -D latex_paper_size=letter
|
||
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||
|
|
||
|
clean::
|
||
|
-rm -rf $(BUILDDIR)/
|
||
|
|
||
|
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."
|
||
|
|
||
|
%:
|
||
|
$(SPHINXBUILD) -b $@ $(ALLSPHINXOPTS) $(BUILDDIR)/$@
|