History

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

Paulo Miguel Almeida committed 3 years ago

Commit 40bf2fc1 parent d717a3a2 files · +14 −0Browse files

Unified · Split

2 files
  1. Documentation/kbuild/kbuild.rst +7 −0
  2. scripts/tags.sh +7 −0
Documentation/kbuild/kbuild.rst+7−0
@@ -278,6 +278,13 @@ To get all available archs you can also specify all. E.g.:: · 277 unmodified lines
278 278
279 $ make ALLSOURCE_ARCHS=all tags279 $ make ALLSOURCE_ARCHS=all tags
280 280
281IGNORE_DIRS
282-----------
283For tags/TAGS/cscope targets, you can choose which directories won't
284be included in the databases, separated by blank space. E.g.::
285
286 $ make IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope
287
281KBUILD_BUILD_TIMESTAMP288KBUILD_BUILD_TIMESTAMP
282----------------------289----------------------
283Setting this to a date string overrides the timestamp used in the290Setting this to a date string overrides the timestamp used in the
scripts/tags.sh+7−0
@@ -17,6 +17,13 @@ ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )" · 16 unmodified lines
17# tags and cscope files should also ignore MODVERSION *.mod.c files17# tags and cscope files should also ignore MODVERSION *.mod.c files
18ignore="$ignore ( -name *.mod.c ) -prune -o"18ignore="$ignore ( -name *.mod.c ) -prune -o"
19 19
20# ignore arbitrary directories
21if [ -n "${IGNORE_DIRS}" ]; then
22 for i in ${IGNORE_DIRS}; do
23 ignore="${ignore} ( -path $i ) -prune -o"
24 done
25fi
26
20# Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}27# Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}
21# to force full paths for a non-O= build28# to force full paths for a non-O= build
22if [ "${srctree}" = "." -o -z "${srctree}" ]; then29if [ "${srctree}" = "." -o -z "${srctree}" ]; then

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t