From: Carlos Bilbao <carlos.bilbao@amd.com>
To: <corbet@lwn.net>, <ojeda@kernel.org>
Cc: <jani.nikula@linux.intel.com>, <rdunlap@infradead.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<konstantin@linuxfoundation.org>,
Carlos Bilbao <carlos.bilbao@amd.com>,
Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH v7 2/2] docs: Integrate rustdoc generation into htmldocs
Date: Mon, 17 Jul 2023 10:16:24 -0500 [thread overview]
Message-ID: <20230717151624.3470714-3-carlos.bilbao@amd.com> (raw)
In-Reply-To: <20230717151624.3470714-1-carlos.bilbao@amd.com>
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>
---
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
next prev parent reply other threads:[~2023-07-17 15:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 15:16 [PATCH v7 0/2] docs: Integrate rustdoc into Rust documentation Carlos Bilbao
2023-07-17 15:16 ` [PATCH v7 1/2] docs: Move rustdoc output, cross-reference it Carlos Bilbao
2023-07-17 16:37 ` Miguel Ojeda
2023-07-18 13:49 ` Carlos Bilbao
2023-07-18 15:24 ` Miguel Ojeda
2023-07-17 15:16 ` Carlos Bilbao [this message]
2023-07-17 16:39 ` [PATCH v7 2/2] docs: Integrate rustdoc generation into htmldocs Miguel Ojeda
2023-07-18 13:54 ` Carlos Bilbao
2023-07-18 15:32 ` Miguel Ojeda
2023-07-17 16:29 ` [PATCH v7 0/2] docs: Integrate rustdoc into Rust documentation Carlos Bilbao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230717151624.3470714-3-carlos.bilbao@amd.com \
--to=carlos.bilbao@amd.com \
--cc=akiyks@gmail.com \
--cc=corbet@lwn.net \
--cc=jani.nikula@linux.intel.com \
--cc=konstantin@linuxfoundation.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®