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
278278
279279 $ make ALLSOURCE_ARCHS=all tags
280280
281+IGNORE_DIRS
282+-----------
283+For tags/TAGS/cscope targets, you can choose which directories won't
284+be included in the databases, separated by blank space. E.g.::
285+
286+ $ make IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope
287+
281288 KBUILD_BUILD_TIMESTAMP
282289 ----------------------
283290 Setting 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
1717 # tags and cscope files should also ignore MODVERSION *.mod.c files
1818 ignore="$ignore ( -name *.mod.c ) -prune -o"
1919
20+# ignore arbitrary directories
21+if [ -n "${IGNORE_DIRS}" ]; then
22+ for i in ${IGNORE_DIRS}; do
23+ ignore="${ignore} ( -path $i ) -prune -o"
24+ done
25+fi
26+
2027 # Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}
2128 # to force full paths for a non-O= build
2229 if [ "${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