[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230504201833.202494-2-darwi@linutronix.de>
Date: Thu, 4 May 2023 22:18:33 +0200
From: "Ahmed S. Darwish" <darwi@...utronix.de>
To: Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kbuild@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
"Ahmed S. Darwish" <darwi@...utronix.de>
Subject: [PATCH v1 1/1] scripts/tags.sh: Fix gtags generation for O= kernel builds
gtags considers any file outside of its current working directory
"outside the source tree" and refuses to index it.
For O= kernel builds, scripts/tags.sh invokes gtags with the current
working directory set to ${O}. This leads to gtags ignoring the entire
kernel source and generating an empty index.
For O= builds, set gtags' working directory to the kernel source tree
and explicitly set its output path through parameters instead.
Signed-off-by: Ahmed S. Darwish <darwi@...utronix.de>
---
scripts/tags.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/tags.sh b/scripts/tags.sh
index ea31640b2671..1a6db535503b 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -131,7 +131,14 @@ docscope()
dogtags()
{
- all_target_sources | gtags -i -f -
+ # gtags refuses to index any file outside of the current working
+ # directory. For O= builds, set the current working directory to
+ # the kernel source tree and the output tags dir to ${O}.
+ suffixparams=
+ if [ -v O ]; then
+ suffixparams="-C $tree $O"
+ fi
+ all_target_sources | gtags -i -f - $suffixparams
}
# Basic regular expressions with an optional /kind-spec/ for ctags and
--
2.30.2
Powered by blists - more mailing lists