mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 01:08:13 -04:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user