summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorVinay Varma <varmavinaym@gmail.com>2023-04-11 17:17:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-28 21:58:57 +0100
commit88a96a6fb12939c6e7d446561ef80b410c53ee5a (patch)
treef226f8fe7fbd097c80e5b1a124dcd5ea5240b19a /Makefile
parentd266fc89bc9a152cfa8a256ba8b5d916e559721c (diff)
downloadlinux-88a96a6fb12939c6e7d446561ef80b410c53ee5a.tar.gz
linux-88a96a6fb12939c6e7d446561ef80b410c53ee5a.tar.bz2
linux-88a96a6fb12939c6e7d446561ef80b410c53ee5a.zip
scripts: `make rust-analyzer` for out-of-tree modules
[ Upstream commit 49a9ef76740206d52e7393f6fe25fc764de8df32 ] Adds support for out-of-tree rust modules to use the `rust-analyzer` make target to generate the rust-project.json file. The change involves adding an optional parameter `external_src` to the `generate_rust_analyzer.py` which expects the path to the out-of-tree module's source directory. When this parameter is passed, I have chosen not to add the non-core modules (samples and drivers) into the result since these are not expected to be used in third party modules. Related changes are also made to the Makefile and rust/Makefile allowing the `rust-analyzer` target to be used for out-of-tree modules as well. Link: https://github.com/Rust-for-Linux/linux/pull/914 Link: https://github.com/Rust-for-Linux/rust-out-of-tree-module/pull/2 Signed-off-by: Vinay Varma <varmavinaym@gmail.com> Link: https://lore.kernel.org/r/20230411091714.130525-1-varmavinaym@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 58d17d339578..8d9cb47a76f2 100644
--- a/Makefile
+++ b/Makefile
@@ -1851,11 +1851,6 @@ rustfmt:
rustfmtcheck: rustfmt_flags = --check
rustfmtcheck: rustfmt
-# IDE support targets
-PHONY += rust-analyzer
-rust-analyzer:
- $(Q)$(MAKE) $(build)=rust $@
-
# Misc
# ---------------------------------------------------------------------------
@@ -1908,6 +1903,7 @@ help:
@echo ' modules - default target, build the module(s)'
@echo ' modules_install - install the module'
@echo ' clean - remove generated files in module directory only'
+ @echo ' rust-analyzer - generate rust-project.json rust-analyzer support file'
@echo ''
endif # KBUILD_EXTMOD
@@ -2044,6 +2040,11 @@ quiet_cmd_tags = GEN $@
tags TAGS cscope gtags: FORCE
$(call cmd,tags)
+# IDE support targets
+PHONY += rust-analyzer
+rust-analyzer:
+ $(Q)$(MAKE) $(build)=rust $@
+
# Script to generate missing namespace dependencies
# ---------------------------------------------------------------------------