[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230717151624.3470714-3-carlos.bilbao@amd.com>
Date: Mon, 17 Jul 2023 10:16:24 -0500
From: Carlos Bilbao <carlos.bilbao@....com>
To: <corbet@....net>, <ojeda@...nel.org>
CC: <jani.nikula@...ux.intel.com>, <rdunlap@...radead.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<konstantin@...uxfoundation.org>,
Carlos Bilbao <carlos.bilbao@....com>,
Akira Yokosawa <akiyks@...il.com>
Subject: [PATCH v7 2/2] 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@...il.com>
Signed-off-by: Carlos Bilbao <carlos.bilbao@....com>
---
Documentation/Makefile | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 023fa658a0a8..3c375c34fd81 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,20 @@ 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
+else
+ @echo " Skipping Rust documentation since CONFIG_RUST is not y."
+endif
+else
+ @echo " Skipping Rust documentation since .config was not found."
+endif
+
texinfodocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))
--
2.34.1
Powered by blists - more mailing lists