Skip to content

Commit c352110

Browse files
Zildj1anJonathan Corbet
authored andcommitted
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 <[email protected]> Signed-off-by: Carlos Bilbao <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 48fadf4 commit c352110

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Documentation/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
5959
KERNELDOC = $(srctree)/scripts/kernel-doc
6060
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
6161
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
6268
# the i18n builder cannot share the environment and doctrees with the others
6369
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
6470

@@ -95,6 +101,16 @@ htmldocs:
95101
@$(srctree)/scripts/sphinx-pre-install --version-check
96102
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
97103

104+
# If Rust support is available and .config exists, add rustdoc generated contents.
105+
# If there are any, the errors from this make rustdoc will be displayed but
106+
# won't stop the execution of htmldocs
107+
108+
ifneq ($(wildcard $(srctree)/.config),)
109+
ifeq ($(CONFIG_RUST),y)
110+
$(Q)$(MAKE) rustdoc || true
111+
endif
112+
endif
113+
98114
texinfodocs:
99115
@$(srctree)/scripts/sphinx-pre-install --version-check
100116
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))

0 commit comments

Comments
 (0)