[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221128201932.168313-1-carlos.bilbao@amd.com>
Date: Mon, 28 Nov 2022 14:19:32 -0600
From: Carlos Bilbao <carlos.bilbao@....com>
To: <corbet@....net>, <ojeda@...nel.org>
CC: <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<bilbao@...edu>, Carlos Bilbao <carlos.bilbao@....com>
Subject: [PATCH] docs: Integrate rustdoc-generated output to Rust docs
Include HTML output generated from rustdoc into the Linux kernel
documentation on Rust. Add Makefile target `make htmlrust` to combine
make htmldocs and the generation of Rust documentation.
Signed-off-by: Carlos Bilbao <carlos.bilbao@....com>
---
Documentation/Makefile | 11 +++++++++++
Documentation/rust/index.rst | 1 +
Documentation/rust/rustdoc.rst | 10 ++++++++++
Makefile | 2 +-
4 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 Documentation/rust/rustdoc.rst
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 64d44c1ecad3..02ed01fa3499 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -95,6 +95,17 @@ htmldocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
+ifdef CONFIG_RUST
+htmlrust:
+ @make rustavailable
+ @make LLVM=1 rustdoc
+ @cp -r rust/doc/* Documentation/output/
+ @make htmldocs
+else
+htmlrust:
+ @echo "Error: CONFIG_RUST must be defined (see .config)"
+endif
+
linkcheckdocs:
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
diff --git a/Documentation/rust/index.rst b/Documentation/rust/index.rst
index 4ae8c66b94fa..5e7a9d39af90 100644
--- a/Documentation/rust/index.rst
+++ b/Documentation/rust/index.rst
@@ -13,6 +13,7 @@ in the kernel, please read the quick-start.rst guide.
general-information
coding-guidelines
arch-support
+ rustdoc
.. only:: subproject and html
diff --git a/Documentation/rust/rustdoc.rst b/Documentation/rust/rustdoc.rst
new file mode 100644
index 000000000000..74581367417b
--- /dev/null
+++ b/Documentation/rust/rustdoc.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Rustdoc output
+==============
+
+If this documentation includes rustdoc-generated HTML, this is the
+entry point.
+
+.. raw:: html
+ :file: doc/kernel/index.html
diff --git a/Makefile b/Makefile
index f41ec8c8426b..c7e00bf928ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1785,7 +1785,7 @@ $(help-board-dirs): help-%:
# Documentation targets
# ---------------------------------------------------------------------------
DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
- linkcheckdocs dochelp refcheckdocs
+ linkcheckdocs dochelp refcheckdocs htmlrust
PHONY += $(DOC_TARGETS)
$(DOC_TARGETS):
$(Q)$(MAKE) $(build)=Documentation $@
--
2.34.1
Powered by blists - more mailing lists