]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - Documentation/Makefile.sphinx
Documentation: exclude media documentation from pdf generation
[mirror_ubuntu-zesty-kernel.git] / Documentation / Makefile.sphinx
CommitLineData
22cba31b
JN
1# -*- makefile -*-
2# Makefile for Sphinx documentation
3#
4
5# You can set these variables from the command line.
6SPHINXBUILD = sphinx-build
7SPHINXOPTS =
8PAPER =
9BUILDDIR = $(obj)/output
10
11# User-friendly check for sphinx-build
12HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi)
13
14ifeq ($(HAVE_SPHINX),0)
15
16.DEFAULT:
17 $(warning The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed and in PATH, or set the SPHINXBUILD make variable to point to the full path of the '$(SPHINXBUILD)' executable.)
18 @echo " SKIP Sphinx $@ target."
19
6387872c
JN
20else ifneq ($(DOCBOOKS),)
21
22# Skip Sphinx build if the user explicitly requested DOCBOOKS.
23.DEFAULT:
24 @echo " SKIP Sphinx $@ target (DOCBOOKS specified)."
25
22cba31b
JN
26else # HAVE_SPHINX
27
f907ba93
JN
28# User-friendly check for pdflatex
29HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; else echo 0; fi)
22cba31b
JN
30
31# Internal variables.
32PAPEROPT_a4 = -D latex_paper_size=a4
33PAPEROPT_letter = -D latex_paper_size=letter
24dcdeb2
JN
34KERNELDOC = $(srctree)/scripts/kernel-doc
35KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
c13ce448 36ALLSPHINXOPTS = -D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) -d $(BUILDDIR)/.doctrees $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) -c $(srctree)/$(src) $(SPHINXOPTS) $(srctree)/$(src)
22cba31b
JN
37# the i18n builder cannot share the environment and doctrees with the others
38I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
39
40quiet_cmd_sphinx = SPHINX $@
609afe6b 41 cmd_sphinx = $(MAKE) BUILDDIR=$(BUILDDIR) $(build)=Documentation/media all; BUILDDIR=$(BUILDDIR) $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2
22cba31b
JN
42
43htmldocs:
44 $(call cmd,sphinx,html)
45
46pdfdocs:
f907ba93
JN
47ifeq ($(HAVE_PDFLATEX),0)
48 $(warning The 'pdflatex' command was not found. Make sure you have it installed and in PATH to produce PDF output.)
22cba31b 49 @echo " SKIP Sphinx $@ target."
f907ba93
JN
50else # HAVE_PDFLATEX
51 $(call cmd,sphinx,latex)
52 $(Q)$(MAKE) -C $(BUILDDIR)/latex
53endif # HAVE_PDFLATEX
22cba31b
JN
54
55epubdocs:
56 $(call cmd,sphinx,epub)
57
58xmldocs:
59 $(call cmd,sphinx,xml)
60
61# no-ops for the Sphinx toolchain
62sgmldocs:
63psdocs:
64mandocs:
65installmandocs:
66
67cleandocs:
68 $(Q)rm -rf $(BUILDDIR)
69
d9a77fe2
JN
70endif # HAVE_SPHINX
71
ebc88ef0
JN
72dochelp:
73 @echo ' Linux kernel internal documentation in different formats (Sphinx):'
74 @echo ' htmldocs - HTML'
75 @echo ' pdfdocs - PDF'
76 @echo ' epubdocs - EPUB'
77 @echo ' xmldocs - XML'
78 @echo ' cleandocs - clean all generated files'