mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
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
This commit is contained in:
parent
48fadf4400
commit
c35211059b
1 changed files with 16 additions and 0 deletions
|
@ -59,6 +59,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
|
||||||
KERNELDOC = $(srctree)/scripts/kernel-doc
|
KERNELDOC = $(srctree)/scripts/kernel-doc
|
||||||
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
|
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
|
||||||
ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
|
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
|
# the i18n builder cannot share the environment and doctrees with the others
|
||||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||||
|
|
||||||
|
@ -95,6 +101,16 @@ htmldocs:
|
||||||
@$(srctree)/scripts/sphinx-pre-install --version-check
|
@$(srctree)/scripts/sphinx-pre-install --version-check
|
||||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
|
@+$(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:
|
texinfodocs:
|
||||||
@$(srctree)/scripts/sphinx-pre-install --version-check
|
@$(srctree)/scripts/sphinx-pre-install --version-check
|
||||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))
|
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))
|
||||||
|
|
Loading…
Reference in a new issue