File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1162,11 +1162,7 @@ export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps
11621162ifeq ($(KBUILD_EXTMOD ) ,)
11631163core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/
11641164core-$(CONFIG_BLOCK) += block/
1165-
1166- # Keep this one as an `ifdef` block since its `Makefile` runs `rustc`.
1167- ifdef CONFIG_RUST
1168- core-y += rust/
1169- endif
1165+ core-$(CONFIG_RUST) += rust/
11701166
11711167vmlinux-dirs := $(patsubst % /,% ,$(filter % /, \
11721168 $(core-y ) $(core-m ) $(drivers-y ) $(drivers-m ) \
@@ -1584,7 +1580,7 @@ MRPROPER_FILES += include/config include/generated \
15841580 certs/x509.genkey \
15851581 vmlinux-gdb.py \
15861582 *.spec \
1587- rust/*_generated.h rust/*_generated.rs rust/ libmacros.so
1583+ rust/libmacros.so
15881584
15891585# clean - Delete most, but leave enough to build external modules
15901586#
Original file line number Diff line number Diff line change 1717
1818obj-$(CONFIG_RUST) += exports.o
1919
20+ # Avoids running `$(RUSTC)` for the sysroot when it may not be available.
21+ ifdef CONFIG_RUST
22+
2023ifeq ($(quiet ) ,silent_)
2124cargo_quiet =-q
2225rust_test_quiet =-q
@@ -346,3 +349,5 @@ $(objtree)/rust/core.o: $$(RUST_LIB_SRC)/core/src/lib.rs FORCE
346349rustdoc-core : private rustc_target_flags = $(core-cfgs )
347350rustdoc-core : $$(RUST_LIB_SRC ) /core/src/lib.rs FORCE
348351 $(call if_changed,rustdoc)
352+
353+ endif # CONFIG_RUST
You can’t perform that action at this time.
0 commit comments