summaryrefslogtreecommitdiff
path: root/scripts/tags.sh
diff options
context:
space:
mode:
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>2022-12-14 09:26:15 +1300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-20 12:05:56 +0100
commit40bf2fcd85e5997b419e49f72d0df694b8274586 (patch)
treecf00b3056de081026d9d686672dc786c3c0f217d /scripts/tags.sh
parentd717a3ab282f51ec45142f911f7ef8a55c057de5 (diff)
scripts/tags.sh: choose which directories to exclude from being indexed
It's common for drivers that share same physical components to also duplicate source code (or at least portions of it). A good example is both drivers/gpu/drm/amdgpu/* and drivers/gpu/drm/radeon/* have a header file called atombios.h. While their contents aren't the same, a lot of their structs have the exact same names which makes navigating through the code base a bit messy as cscope will show up 'references' across drivers which aren't exactly correct. Add IGNORE_DIRS variable, which specifies which directories to be ignored from indexing. Example: make ARCH=x86 IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Reviewed-by: Vipin Sharma <vipinsh@google.com> Link: https://lore.kernel.org/r/Y5jf59VCL/HAt60q@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/tags.sh')
-rwxr-xr-xscripts/tags.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/tags.sh b/scripts/tags.sh
index e137cf15aae9..1ad45f17179a 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -17,6 +17,13 @@ ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )"
# tags and cscope files should also ignore MODVERSION *.mod.c files
ignore="$ignore ( -name *.mod.c ) -prune -o"
+# ignore arbitrary directories
+if [ -n "${IGNORE_DIRS}" ]; then
+ for i in ${IGNORE_DIRS}; do
+ ignore="${ignore} ( -path $i ) -prune -o"
+ done
+fi
+
# Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}
# to force full paths for a non-O= build
if [ "${srctree}" = "." -o -z "${srctree}" ]; then