kivy/doc/Makefile

167 lines
4.8 KiB
Makefile
Raw Normal View History

2010-11-03 21:05:03 +00:00
# Makefile for Sphinx documentation
#
ENDUSER_BUILD = yes
2010-11-03 21:05:03 +00:00
# You can set these variables from the command line.
2020-10-16 17:41:57 +00:00
PYTHON = python3
ifeq (, $(shell which $(PYTHON) 2> /dev/null ))
PYTHON := python
endif
ifeq (, $(shell which $(PYTHON) 2> /dev/null))
$(error "PYTHON=$(PYTHON) not found in $(PATH)")
endif
2015-01-24 15:26:14 +00:00
SPHINXOPTS = -Q
SPHINXOPTS_TEST = -W -T
2015-01-24 15:26:14 +00:00
SPHINXBUILD = sphinx-build
PAPER =
2010-11-03 21:05:03 +00:00
2015-02-22 05:12:17 +00:00
fasthtml: SPHINXOPTS += -j4
2016-09-07 09:23:44 +00:00
# platform independent path separator
2014-02-23 00:07:30 +00:00
# only system calls need to use $(P), b/c on win system calls have issues with /
ifdef ComSpec
PATHSEP2=\\
MKDIR=mkdir
else
PATHSEP2=/
MKDIR=mkdir -p
endif
P=$(strip $(PATHSEP2))
2010-11-03 21:05:03 +00:00
# Internal variables.
2015-01-24 15:26:14 +00:00
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
ALLSPHINXOPTS_TEST = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS_TEST) sources
ALLSPHINXOPTSGT = -d build/doctrees_gettext $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
ALLSPHINXOPTSGT_TEST = -d build/doctrees_gettext $(PAPEROPT_$(PAPER)) $(SPHINXOPTS_TEST) sources
2015-01-24 17:20:43 +00:00
LATEXOPTS = -interaction=batchmode
2020-10-16 17:41:57 +00:00
LATEXOPTS_TESTS =
2010-11-03 21:05:03 +00:00
ifeq ($(ENDUSER_BUILD),yes)
2020-10-16 17:41:57 +00:00
_TESTS =
else
_TESTS = _TEST
endif
2016-08-28 03:19:03 +00:00
# Created in autobuild.py
AUTOBUILD_STAMP = "autobuild.py-done"
2011-10-04 13:59:11 +00:00
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck gettext
2010-11-03 21:05:03 +00:00
help:
@echo "Please use \`make <target>' where <target> is one of"
2015-01-27 23:34:26 +00:00
@echo " build-all to build the common documentation types."
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " clean to remove generated files"
2015-01-27 23:34:26 +00:00
@echo " gettext to make gettext pages"
2010-11-03 21:05:03 +00:00
@echo " html to make standalone HTML files"
2015-02-22 05:12:17 +00:00
@echo " fasthtml same as html, with 4 concurrent processes"
2010-11-03 21:05:03 +00:00
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2015-01-27 23:34:26 +00:00
@echo " linkcheck to check through the reference linking"
@echo " man to build Man doctrees."
@echo " pdf to make standalone PDF files"
@echo " pickle to make pickle files (usable by e.g. sphinx-web)"
@echo " ps to make standalone PS files"
2015-01-27 23:34:26 +00:00
@echo " web same as pickle"
2010-11-03 21:05:03 +00:00
clean:
-rm -rf sources/api-*.rst
-rm -rf sources/examples/gen__*.rst
-rm -rf sources/examples/gallery.rst
-rm -rf sources/examples/index.rst
2014-02-23 00:07:30 +00:00
# windows just doesn't support e.g. build\*
ifdef ComSpec
-rmdir /s /q build
else
2010-11-03 21:05:03 +00:00
-rm -rf build/*
2016-08-28 03:19:03 +00:00
-rm $(AUTOBUILD_STAMP)*
2014-02-23 00:07:30 +00:00
endif
2010-11-03 21:05:03 +00:00
2015-02-22 05:12:17 +00:00
fasthtml: html
2010-11-03 21:05:03 +00:00
html:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)html build$(P)doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS$(_TESTS)) build/html
2010-11-03 21:05:03 +00:00
@echo
@echo "Build finished. The HTML pages are in build/html."
2011-10-04 13:59:11 +00:00
gettext:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)html build$(P)doctrees_gettext
$(SPHINXBUILD) -b gettext $(ALLSPHINXOPTSGT$(_TESTS)) build/gettext
2011-10-04 13:59:11 +00:00
@echo
@echo "Build finished. The Gettext pages are in build/gettext."
2010-11-03 21:05:03 +00:00
pickle:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)pickle build$(P)doctrees
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS$(_TESTS)) build/pickle
2010-11-03 21:05:03 +00:00
@echo
@echo "Build finished; now you can process the pickle files or run"
@echo " sphinx-web build/pickle"
@echo "to start the sphinx-web server."
web: pickle
htmlhelp:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)htmlhelp build$(P)doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS$(_TESTS)) build/htmlhelp
2010-11-03 21:05:03 +00:00
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in build/htmlhelp."
latex:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)latex build$(P)doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS$(_TESTS)) build/latex
2010-11-03 21:05:03 +00:00
@echo
@echo "Build finished; the LaTeX files are in build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' to" \
2010-11-03 21:05:03 +00:00
"run these through (pdf)latex."
pdf: latex
rm -f build$(P)latex$(P)Kivy.pdf
-$(MAKE) -C build$(P)latex all-pdf LATEXOPTS=$(LATEXOPTS$(_TESTS))
2015-12-01 10:22:13 +00:00
ifneq ("$(wildcard build$(P)latex$(P)Kivy.pdf)","")
@echo
@echo "Build finished; the PDF file(s) are in build/latex."
2016-09-07 09:23:44 +00:00
@echo "You can safely ignore the errors which might appeared above!"
else
@echo
@echo "Build failed; there is no PDF file(s) in build/latex."
exit 1
endif
ps: latex
$(MAKE) -C build$(P)latex all-ps
@echo
@echo "Build finished; the PS files are in build/latex."
man:
$(MKDIR) build$(P)man build$(P)doctrees
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS$(_TESTS)) build/man
@echo
@echo "Build finished. The manual pages are in build/man."
2010-11-03 21:05:03 +00:00
changes:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)changes build$(P)doctrees
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS$(_TESTS)) build/changes
2010-11-03 21:05:03 +00:00
@echo
@echo "The overview file is in build/changes."
linkcheck:
2014-02-23 00:07:30 +00:00
$(MKDIR) build$(P)linkcheck build$(P)doctrees
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS$(_TESTS)) build/linkcheck
2010-11-03 21:05:03 +00:00
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in build/linkcheck/output.txt."
build-all: html pickle htmlhelp pdf ps gettext
2020-10-16 17:41:57 +00:00
# TODO: Make test run in non-enduser-build mode
test: build-all