@@ -15,8 +15,9 @@ always-$(CONFIG_RUST) += libmacros.so
15
15
no-clean-files += libmacros.so
16
16
17
17
always-$(CONFIG_RUST) += bindings_generated.rs bindings_helpers_generated.rs
18
- obj-$(CONFIG_RUST) += alloc.o kernel.o
19
- always-$(CONFIG_RUST) += exports_alloc_generated.h exports_kernel_generated.h
18
+ obj-$(CONFIG_RUST) += alloc.o bindings.o kernel.o
19
+ always-$(CONFIG_RUST) += exports_alloc_generated.h exports_bindings_generated.h \
20
+ exports_kernel_generated.h
20
21
21
22
ifdef CONFIG_RUST_BUILD_ASSERT_DENY
22
23
always-$(CONFIG_RUST) += build_error.o
@@ -110,10 +111,11 @@ rustdoc-alloc: $(src)/alloc/lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
110
111
$(call if_changed,rustdoc)
111
112
112
113
rustdoc-kernel : private rustc_target_flags = --extern alloc \
113
- --extern build_error --extern macros=$(objtree)/$(obj)/libmacros.so
114
+ --extern build_error --extern macros=$(objtree)/$(obj)/libmacros.so \
115
+ --extern bindings
114
116
rustdoc-kernel : $(src ) /kernel/lib.rs rustdoc-core rustdoc-macros \
115
117
rustdoc-compiler_builtins rustdoc-alloc $(obj)/libmacros.so \
116
- $(obj)/bindings_generated.rs $(obj)/bindings_helpers_generated.rs FORCE
118
+ $(obj)/bindings.o FORCE
117
119
$(call if_changed,rustdoc)
118
120
119
121
quiet_cmd_rustc_test_library = RUSTC TL $<
@@ -154,6 +156,7 @@ quiet_cmd_rustdoc_test_kernel = RUSTDOC TK $<
154
156
@$(objtree ) /include/generated/rustc_cfg \
155
157
-L$(objtree ) /$(obj ) --extern alloc --extern kernel \
156
158
--extern build_error --extern macros \
159
+ --extern bindings \
157
160
--no-run --crate-name kernel -Zunstable-options \
158
161
--test-builder $(srctree ) /scripts/rustdoc_test_builder.py \
159
162
$< $(rustdoc_test_kernel_quiet ) ; \
@@ -234,8 +237,7 @@ rusttest-macros: $(src)/macros/lib.rs rusttest-prepare FORCE
234
237
$(call if_changed,rustdoc_test)
235
238
236
239
rusttest-kernel : private rustc_target_flags = --extern alloc \
237
- --extern build_error --extern macros
238
- rusttest-kernel : private rustc_test_run_flags = --skip bindgen_test_layout_
240
+ --extern build_error --extern macros --extern bindings
239
241
rusttest-kernel : $(src ) /kernel/lib.rs rusttest-prepare \
240
242
rusttestlib-build_error rusttestlib-macros FORCE
241
243
$(call if_changed,rustc_test)
@@ -335,6 +337,9 @@ $(obj)/exports_core_generated.h: $(obj)/core.o FORCE
335
337
$(obj ) /exports_alloc_generated.h : $(obj ) /alloc.o FORCE
336
338
$(call if_changed,exports)
337
339
340
+ $(obj ) /exports_bindings_generated.h : $(obj ) /bindings.o FORCE
341
+ $(call if_changed,exports)
342
+
338
343
$(obj ) /exports_kernel_generated.h : $(obj ) /kernel.o FORCE
339
344
$(call if_changed,exports)
340
345
@@ -388,11 +393,16 @@ $(obj)/alloc.o: $(src)/alloc/lib.rs $(obj)/compiler_builtins.o FORCE
388
393
$(obj ) /build_error.o : $(src ) /build_error.rs $(obj ) /compiler_builtins.o FORCE
389
394
$(call if_changed_dep,rustc_library)
390
395
396
+ $(obj ) /bindings.o : $(src ) /kernel/bindings.rs \
397
+ $(obj ) /compiler_builtins.o \
398
+ $(obj)/bindings_generated.rs \
399
+ $(obj)/bindings_helpers_generated.rs FORCE
400
+ $(call if_changed_dep,rustc_library)
401
+
391
402
$(obj ) /kernel.o : private rustc_target_flags = --extern alloc \
392
- --extern build_error --extern macros
403
+ --extern build_error --extern macros --extern bindings
393
404
$(obj ) /kernel.o : $(src ) /kernel/lib.rs $(obj ) /alloc.o $(obj ) /build_error.o \
394
- $(obj)/libmacros.so $(obj)/bindings_generated.rs \
395
- $(obj)/bindings_helpers_generated.rs FORCE
405
+ $(obj)/libmacros.so $(obj)/bindings.o FORCE
396
406
$(call if_changed_dep,rustc_library)
397
407
398
408
endif # CONFIG_RUST
0 commit comments