summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-01-07 18:45:45 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-01-22 23:43:33 +0900
commitc83b16cefd78f55071840e1159ead9fe62747769 (patch)
treef103dd2763d7d48a7bfa070480a8db8082751329 /scripts
parent93c656de8da8b53317bd88ecb7cce592310995d8 (diff)
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 'scripts')
-rw-r--r--scripts/.gitignore1
-rw-r--r--scripts/Makefile8
-rwxr-xr-xscripts/remove-stale-files2
3 files changed, 10 insertions, 1 deletions
diff --git a/scripts/.gitignore b/scripts/.gitignore
index b7aec8eb1bd4..11bf3c075fb6 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -8,4 +8,5 @@
/recordmcount
/sign-file
/sorttable
+/target.json
/unifdef
diff --git a/scripts/Makefile b/scripts/Makefile
index 1575af84d557..0e0ae3c06ed7 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -10,8 +10,14 @@ hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
hostprogs-always-$(CONFIG_ASN1) += asn1_compiler
hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
-hostprogs-always-$(CONFIG_RUST) += generate_rust_target
+always-$(CONFIG_RUST) += target.json
+filechk_rust_target = $< < include/config/auto.conf
+
+$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE
+ $(call filechk,rust_target)
+
+hostprogs += generate_rust_target
generate_rust_target-rust := y
HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
index cdbdde89a271..c71bf2f68360 100755
--- a/scripts/remove-stale-files
+++ b/scripts/remove-stale-files
@@ -27,3 +27,5 @@ rm -f arch/x86/purgatory/kexec-purgatory.c
rm -f scripts/extract-cert
rm -f scripts/kconfig/[gmnq]conf-cfg
+
+rm -f rust/target.json