Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: Move rustdoc output, cross-reference it

Generate rustdoc documentation with the rest of subsystem's documentation
in Documentation/output. Add a cross reference to the generated rustdoc in
Documentation/rust/index.rst if Sphinx target rustdoc is set.

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-2-carlos.bilbao@amd.com

authored by

Carlos Bilbao and committed by
Jonathan Corbet
48fadf44 b4047e53

+17 -6
+8
Documentation/rust/index.rst
··· 6 6 Documentation related to Rust within the kernel. To start using Rust 7 7 in the kernel, please read the quick-start.rst guide. 8 8 9 + .. only:: rustdoc and html 10 + 11 + You can also browse `rustdoc documentation <rustdoc/kernel/index.html>`_. 12 + 13 + .. only:: not rustdoc and html 14 + 15 + This documentation does not include rustdoc generated information. 16 + 9 17 .. toctree:: 10 18 :maxdepth: 1 11 19
+9 -6
rust/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 + # Where to place rustdoc generated documentation 4 + rustdoc_output := $(objtree)/Documentation/output/rust/rustdoc 5 + 3 6 obj-$(CONFIG_RUST) += core.o compiler_builtins.o 4 7 always-$(CONFIG_RUST) += exports_core_generated.h 5 8 ··· 68 65 OBJTREE=$(abspath $(objtree)) \ 69 66 $(RUSTDOC) $(if $(rustdoc_host),$(rust_common_flags),$(rust_flags)) \ 70 67 $(rustc_target_flags) -L$(objtree)/$(obj) \ 71 - --output $(objtree)/$(obj)/doc \ 68 + --output $(rustdoc_output) \ 72 69 --crate-name $(subst rustdoc-,,$@) \ 73 70 @$(objtree)/include/generated/rustc_cfg $< 74 71 ··· 85 82 # and then retouch the generated files. 86 83 rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \ 87 84 rustdoc-alloc rustdoc-kernel 88 - $(Q)cp $(srctree)/Documentation/images/logo.svg $(objtree)/$(obj)/doc 89 - $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(objtree)/$(obj)/doc 90 - $(Q)find $(objtree)/$(obj)/doc -name '*.html' -type f -print0 | xargs -0 sed -Ei \ 85 + $(Q)cp $(srctree)/Documentation/images/logo.svg $(rustdoc_output) 86 + $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output) 87 + $(Q)find $(rustdoc_output) -name '*.html' -type f -print0 | xargs -0 sed -Ei \ 91 88 -e 's:rust-logo\.svg:logo.svg:g' \ 92 89 -e 's:rust-logo\.png:logo.svg:g' \ 93 90 -e 's:favicon\.svg:logo.svg:g' \ 94 91 -e 's:<link rel="alternate icon" type="image/png" href="[./]*favicon-(16x16|32x32)\.png">::g' 95 92 $(Q)echo '.logo-container > img { object-fit: contain; }' \ 96 - >> $(objtree)/$(obj)/doc/rustdoc.css 93 + >> $(rustdoc_output)/rustdoc.css 97 94 98 95 rustdoc-macros: private rustdoc_host = yes 99 96 rustdoc-macros: private rustc_target_flags = --crate-type proc-macro \ ··· 157 154 @$(objtree)/include/generated/rustc_cfg \ 158 155 $(rustc_target_flags) $(rustdoc_test_target_flags) \ 159 156 --sysroot $(objtree)/$(obj)/test/sysroot $(rustdoc_test_quiet) \ 160 - -L$(objtree)/$(obj)/test --output $(objtree)/$(obj)/doc \ 157 + -L$(objtree)/$(obj)/test --output $(rustdoc_output) \ 161 158 --crate-name $(subst rusttest-,,$@) $< 162 159 163 160 # We cannot use `-Zpanic-abort-tests` because some tests are dynamic,