From 9f975bb66fb80eca7a653cb7ad5cd388e5ff3f0d Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Thu, 17 Oct 2024 16:26:22 +0200 Subject: [PATCH] Add clangd target Create a compile_commands.json to help clangd for LSP. --- hw/application_fpga/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/application_fpga/Makefile b/hw/application_fpga/Makefile index ab7b1bf..8f40c1e 100644 --- a/hw/application_fpga/Makefile +++ b/hw/application_fpga/Makefile @@ -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)