Add clangd target

Create a compile_commands.json to help clangd for LSP.
This commit is contained in:
Michael Cardell Widerkrantz 2024-10-17 16:26:22 +02:00 committed by Daniel Jobson
parent fe8f0b1aa9
commit 9f975bb66f
No known key found for this signature in database
GPG Key ID: 3707A9DBF4BB8F1A

View File

@ -180,6 +180,13 @@ qemu_firmware.elf: CFLAGS += -DQEMU_CONSOLE
qemu_firmware.elf: firmware.elf
mv firmware.elf qemu_firmware.elf
# Create compile_commands.json for clangd and LSP
.PHONY: clangd
clangd: compile_commands.json
compile_commands.json:
$(MAKE) clean
bear -- make qemu_firmware.elf
.PHONY: check
check:
clang-tidy -header-filter=.* -checks=cert-* $(FIRMWARE_SOURCES) -- $(CFLAGS)