diff options
author | Jiri Kosina <jkosina@suse.cz> | 2021-03-30 10:17:09 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2021-03-30 10:17:09 +0300 |
commit | a6ad93e37e76ec43c9cee6a91dd783fb854c2ff1 (patch) | |
tree | d091c71637d37d0fb0255af766a9287de6a4611a /scripts/clang-tools/gen_compile_commands.py | |
parent | 69aea9d2843669387d100e353b5113d1adc9502f (diff) | |
parent | aebf0a11a8c1fb6444d1365db97f90672199a867 (diff) | |
download | linux-a6ad93e37e76ec43c9cee6a91dd783fb854c2ff1.tar.xz |
Merge tag 'platform-drivers-x86-surface-aggregator-v5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into for-5.13/surface-system-aggregator-intergration
Pull immutable integration branch from Hans de Goede to have a stable base for
SSAM (Surface System Aggregator Module) HID transport subsystem merge.
=====
Signed tag for the immutable platform-surface-aggregator-registry
branch for merging into other sub-systems.
Note this is based on v5.12-rc2.
=====
Diffstat (limited to 'scripts/clang-tools/gen_compile_commands.py')
-rwxr-xr-x | scripts/clang-tools/gen_compile_commands.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py index 8ddb5d099029..b7e9ecf16e56 100755 --- a/scripts/clang-tools/gen_compile_commands.py +++ b/scripts/clang-tools/gen_compile_commands.py @@ -20,7 +20,9 @@ _DEFAULT_LOG_LEVEL = 'WARNING' _FILENAME_PATTERN = r'^\..*\.cmd$' _LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$' _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] - +# The tools/ directory adopts a different build system, and produces .cmd +# files in a different format. Do not support it. +_EXCLUDE_DIRS = ['.git', 'Documentation', 'include', 'tools'] def parse_arguments(): """Sets up and parses command-line arguments. @@ -80,8 +82,14 @@ def cmdfiles_in_dir(directory): """ filename_matcher = re.compile(_FILENAME_PATTERN) + exclude_dirs = [ os.path.join(directory, d) for d in _EXCLUDE_DIRS ] + + for dirpath, dirnames, filenames in os.walk(directory, topdown=True): + # Prune unwanted directories. + if dirpath in exclude_dirs: + dirnames[:] = [] + continue - for dirpath, _, filenames in os.walk(directory): for filename in filenames: if filename_matcher.match(filename): yield os.path.join(dirpath, filename) |