summaryrefslogtreecommitdiffstats
path: root/rust/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-01-07 10:45:45 +0100
committerMasahiro Yamada <masahiroy@kernel.org>2023-01-22 15:43:33 +0100
commitc83b16cefd78f55071840e1159ead9fe62747769 (patch)
treef103dd2763d7d48a7bfa070480a8db8082751329 /rust/Makefile
parentfixdep: do not parse *.rlib, *.rmeta, *.so (diff)
downloadlinux-c83b16cefd78f55071840e1159ead9fe62747769.tar.xz
linux-c83b16cefd78f55071840e1159ead9fe62747769.zip
kbuild: rust: move rust/target.json to scripts/
scripts/ is a better place to generate files used treewide. With target.json moved to scripts/, you do not need to add target.json to no-clean-files or MRPROPER_FILES. 'make clean' does not visit scripts/, but 'make mrproper' does. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Tested-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/Makefile')
-rw-r--r--rust/Makefile10
1 files changed, 1 insertions, 9 deletions
diff --git a/rust/Makefile b/rust/Makefile
index f403b79cae5a..829f4adfd85c 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-always-$(CONFIG_RUST) += target.json
-no-clean-files += target.json
-
obj-$(CONFIG_RUST) += core.o compiler_builtins.o
always-$(CONFIG_RUST) += exports_core_generated.h
@@ -231,11 +228,6 @@ rusttest-kernel: $(src)/kernel/lib.rs rusttest-prepare \
$(call if_changed,rustc_test)
$(call if_changed,rustc_test_library)
-filechk_rust_target = $(objtree)/scripts/generate_rust_target < $<
-
-$(obj)/target.json: $(objtree)/include/config/auto.conf FORCE
- $(call filechk,rust_target)
-
ifdef CONFIG_CC_IS_CLANG
bindgen_c_flags = $(c_flags)
else
@@ -359,7 +351,7 @@ rust-analyzer:
$(obj)/core.o: private skip_clippy = 1
$(obj)/core.o: private skip_flags = -Dunreachable_pub
$(obj)/core.o: private rustc_target_flags = $(core-cfgs)
-$(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs $(obj)/target.json FORCE
+$(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs scripts/target.json FORCE
$(call if_changed_dep,rustc_library)
$(obj)/compiler_builtins.o: private rustc_objcopy = -w -W '__*'