aboutsummaryrefslogtreecommitdiffstats
path: root/rust
diff options
authorMiguel Ojeda <ojeda@kernel.org>2026-06-08 16:14:23 +0200
committerMiguel Ojeda <ojeda@kernel.org>2026-06-09 04:13:22 +0200
commit50f3637a459a420ec84e73fa93c0ea469c7acdec (patch)
treeee8fac7b8735fb7958a1d7ba1fb9ef7012e7683f /rust
parent34ea644acaf4ed85b14493ffd4284d1c9059372c (diff)
downloadath-50f3637a459a420ec84e73fa93c0ea469c7acdec.tar.gz
rust: kbuild: define `procmacro-name` function
Since we are adding one more proc macro crate (`zerocopy-derive`), we are refactoring their handling. Thus define a `procmacro-name` function and use it to fill the existing variables' values. Reviewed-by: Nicolas Schier <nsc@kernel.org> Link: https://patch.msgid.link/20260608141439.182634-5-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust')
-rw-r--r--rust/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/rust/Makefile b/rust/Makefile
index 2b4a3983bb1e3..8dfccf7399d91 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -47,10 +47,12 @@ endif
# Avoids running `$(RUSTC)` when it may not be available.
ifdef CONFIG_RUST
-libmacros_name := $(shell MAKEFLAGS= $(RUSTC) --print file-names --crate-name macros --crate-type proc-macro - </dev/null)
+procmacro-name = $(shell MAKEFLAGS= $(RUSTC) --print file-names --crate-name $(1) --crate-type proc-macro - </dev/null)
+
+libmacros_name := $(call procmacro-name,macros)
libmacros_extension := $(patsubst libmacros.%,%,$(libmacros_name))
-libpin_init_internal_name := $(shell MAKEFLAGS= $(RUSTC) --print file-names --crate-name pin_init_internal --crate-type proc-macro - </dev/null)
+libpin_init_internal_name := $(call procmacro-name,pin_init_internal)
always-$(CONFIG_RUST) += $(libmacros_name) $(libpin_init_internal_name)