Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Carlos Bilbao and committed by
Jonathan Corbet
c3521105 48fadf44

+16
+16
Documentation/Makefile
··· 59 59 KERNELDOC = $(srctree)/scripts/kernel-doc 60 60 KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC) 61 61 ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) 62 + ifneq ($(wildcard $(srctree)/.config),) 63 + ifeq ($(CONFIG_RUST),y) 64 + # Let Sphinx know we will include rustdoc 65 + ALLSPHINXOPTS += -t rustdoc 66 + endif 67 + endif 62 68 # the i18n builder cannot share the environment and doctrees with the others 63 69 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 64 70 ··· 100 94 htmldocs: 101 95 @$(srctree)/scripts/sphinx-pre-install --version-check 102 96 @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) 97 + 98 + # If Rust support is available and .config exists, add rustdoc generated contents. 99 + # If there are any, the errors from this make rustdoc will be displayed but 100 + # won't stop the execution of htmldocs 101 + 102 + ifneq ($(wildcard $(srctree)/.config),) 103 + ifeq ($(CONFIG_RUST),y) 104 + $(Q)$(MAKE) rustdoc || true 105 + endif 106 + endif 103 107 104 108 texinfodocs: 105 109 @$(srctree)/scripts/sphinx-pre-install --version-check