]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gen_compile_commands: extract compiler command from a series of commands
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 19 Aug 2021 00:57:33 +0000 (09:57 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 27 Aug 2021 05:03:47 +0000 (14:03 +0900)
commit781bcc09e0770ff34a5b95274a485ecafa330d79
tree32e9a93b7be22c7635eb2ed2043adfc88163f515
parentbe6b0d5022afe24952dda07c96f05ff71b77ee83
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>
scripts/clang-tools/gen_compile_commands.py