mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
gen_compile_commands: extract compiler command from a series of commands
The current gen_compile_commands.py assumes that objects are always built by a single command. It makes sense to support cases where objects are built by a series of commands: cmd_<object> := <command1> ; <command2> One use-case is that <command1> is a compiler command, and <command2> an objtool command. It allows *.cmd files to contain an objtool command so that any change in it triggers object rebuilds. If ; appears after the C source file, take the first command. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
7ab44e9ee5
commit
265264b814
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ _DEFAULT_OUTPUT = 'compile_commands.json'
|
|||
_DEFAULT_LOG_LEVEL = 'WARNING'
|
||||
|
||||
_FILENAME_PATTERN = r'^\..*\.cmd$'
|
||||
_LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$'
|
||||
_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.
|
||||
|
|
Loading…
Reference in a new issue