aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_compile_commands.py
AgeCommit message (Collapse)AuthorFilesLines
2024-02-06scripts/gen_compile_commands: update to Linux v6.7Brandon Maier1-7/+7
Adds support for assembly files and updates the LINE_PATTERN so it supports both "cmd" and "savedcmd", which allows reverting the U-Boot modification in commit 97fbb2eb016b ("scripts/gen_compile_commands.py: adapt _LINE_PATTERN"). Upstream commits: - 880946158b011 gen_compile_commands.py: fix path resolve with symlinks in it - 9e56d3be4bfd2 gen_compile_commands: Sort output compile commands by file name - 52c15e7e79285 gen_compile_commands: Allow the line prefix to still be cmd_ - 1c67921444bf6 gen_compile_commands: add assembly files to compilation database Signed-off-by: Brandon Maier <brandon.maier@collins.com> Cc: Joao Marcos Costa <jmcosta944@gmail.com>
2023-10-11scripts/gen_compile_commands: fix usage messageJoao Marcos Costa1-2/+2
Replace mentions to 'kernel' by 'U-Boot' to avoid confusion. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11doc: add documentation for gen_compile_commands.pyJoao Marcos Costa1-0/+1
This documentation briefly explains what is a compilation database, and how to use the script to generate one. This is not a portage, as there was no original documentation in the Linux sources. Acknowledge the documentation in the script's header and in doc/build index. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11scripts/gen_compile_commands.py: add acknowledgmentsJoao Marcos Costa1-0/+1
Add acknowledgments for porting and modifying the script. Of course, the license, author, and copyright notice remain the same as in the original script. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11scripts/gen_compile_commands.py: fix docstringJoao Marcos Costa1-1/+1
The referred tool is now in U-Boot. Replace "the Linux kernel" by "U-Boot" to make the docstring coherent. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11scripts/gen_compile_commands.py: adapt _LINE_PATTERNJoao Marcos Costa1-1/+1
For U-Boot's context, the regular expression defined by _LINE_PATTERN should be adapted. Replace 'savedcmd' by 'cmd'. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11scripts: Port Linux's gen_compile_commands.py to U-BootJoao Marcos Costa1-0/+228
This script generates a database of compiler flags, namely compile_commands.json. It is quite useful for text editors that use clangd LSP (e.g. Vim, Neovim). It was ported from Linux's sources: - tag: v6.4 - revision 6995e2de6891c724bfeb2db33d7b87775f913ad1 Modifications for U-Boot compatibility will be added in a follow-up commit. Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com> Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>