Skip to content

Commit afc3acf

Browse files
committed
docs: rust: generate core docs and fix dependencies
This fixes several links. We will also need this as soon as we start building a subset of `core` through feature flags, e.g. to disable floating-point and 128-bit functionality etc. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent ff004ed commit afc3acf

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

rust/Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,32 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
3737
--output $(objtree)/rust/doc --crate-name $(subst rustdoc-,,$@) \
3838
@$(objtree)/include/generated/rustc_cfg $<
3939

40-
rustdoc: rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc rustdoc-kernel
40+
rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc rustdoc-kernel
4141

4242
rustdoc-macros: private rustdoc_host = yes
4343
rustdoc-macros: private rustc_target_flags = --crate-type proc-macro \
4444
--extern proc_macro
4545
rustdoc-macros: $(srctree)/rust/macros/lib.rs FORCE
4646
$(call if_changed,rustdoc)
4747

48-
rustdoc-compiler_builtins: $(srctree)/rust/compiler_builtins.rs FORCE
48+
rustdoc-compiler_builtins: $(srctree)/rust/compiler_builtins.rs rustdoc-core FORCE
4949
$(call if_changed,rustdoc)
5050

5151
# We need to allow `broken_intra_doc_links` because some
5252
# `no_global_oom_handling` functions refer to non-`no_global_oom_handling`
5353
# functions. Ideally `rustdoc` would have a way to distinguish broken links
5454
# due to things that are "configured out" vs. entirely non-existing ones.
5555
rustdoc-alloc: private rustc_target_flags = --cfg no_global_oom_handling \
56-
-Abroken_intra_doc_links
57-
rustdoc-alloc: $(srctree)/rust/alloc/lib.rs FORCE
56+
-Abroken_intra_doc_links
57+
rustdoc-alloc: $(srctree)/rust/alloc/lib.rs rustdoc-core \
58+
rustdoc-compiler_builtins FORCE
5859
$(call if_changed,rustdoc)
5960

6061
rustdoc-kernel: private rustc_target_flags = --extern alloc \
6162
--extern build_error \
6263
--extern macros=$(objtree)/rust/libmacros.so
63-
rustdoc-kernel: $(srctree)/rust/kernel/lib.rs rustdoc-macros \
64+
rustdoc-kernel: $(srctree)/rust/kernel/lib.rs rustdoc-core \
65+
rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc \
6466
$(objtree)/rust/libmacros.so $(objtree)/rust/bindings_generated.rs FORCE
6567
$(call if_changed,rustdoc)
6668

@@ -299,3 +301,6 @@ $(objtree)/rust/kernel.o: $(srctree)/rust/kernel/lib.rs $(objtree)/rust/alloc.o
299301
$(objtree)/rust/core.o: private skip_clippy = 1
300302
$(objtree)/rust/core.o: $$(RUST_LIB_SRC)/core/src/lib.rs FORCE
301303
$(call if_changed_dep,rustc_library)
304+
305+
rustdoc-core: $$(RUST_LIB_SRC)/core/src/lib.rs FORCE
306+
$(call if_changed,rustdoc)

0 commit comments

Comments
 (0)