summaryrefslogtreecommitdiffstats
path: root/Documentation/Makefile
diff options
context:
space:
mode:
authorCarlos Bilbao <carlos.bilbao@amd.com>2023-07-18 10:15:34 -0500
committerJonathan Corbet <corbet@lwn.net>2023-07-21 15:08:46 -0600
commitc35211059b77ece1360fd2338c8e4935f1a3b30e (patch)
tree86f81ff38bc98355dd612838690bd970d17b8406 /Documentation/Makefile
parent48fadf44007568e75c7af92857083058d57be403 (diff)
downloadlinux-c35211059b77ece1360fd2338c8e4935f1a3b30e.tar.gz
linux-c35211059b77ece1360fd2338c8e4935f1a3b30e.tar.bz2
linux-c35211059b77ece1360fd2338c8e4935f1a3b30e.zip
docs: Integrate rustdoc generation into htmldocs
Change target `make htmldocs` to combine RST Sphinx and the generation of Rust documentation, when support is available and .config exists. Reviewed-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20230718151534.4067460-3-carlos.bilbao@amd.com
Diffstat (limited to 'Documentation/Makefile')
-rw-r--r--Documentation/Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 023fa658a0a8..2f35793acd2a 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -59,6 +59,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
KERNELDOC = $(srctree)/scripts/kernel-doc
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
+ifneq ($(wildcard $(srctree)/.config),)
+ifeq ($(CONFIG_RUST),y)
+ # Let Sphinx know we will include rustdoc
+ ALLSPHINXOPTS += -t rustdoc
+endif
+endif
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
@@ -95,6 +101,16 @@ htmldocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
+# If Rust support is available and .config exists, add rustdoc generated contents.
+# If there are any, the errors from this make rustdoc will be displayed but
+# won't stop the execution of htmldocs
+
+ifneq ($(wildcard $(srctree)/.config),)
+ifeq ($(CONFIG_RUST),y)
+ $(Q)$(MAKE) rustdoc || true
+endif
+endif
+
texinfodocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))