From b58b25516cc302dea5dcff419d6b75cd3c950aea Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Fri, 31 May 2024 13:35:04 +0200 Subject: [PATCH] Makefile.include: place compile_commands.json by rule target --- Makefile.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.include b/Makefile.include index 66eef4c65c..378118c07b 100644 --- a/Makefile.include +++ b/Makefile.include @@ -718,11 +718,12 @@ endif # BUILDOSXNATIVE COMPILE_COMMANDS_PATH ?= $(if $(findstring $(RIOTBASE),$(APPDIR)),$(RIOTBASE)/compile_commands.json, $(APPDIR)/compile_commands.json) COMPILE_COMMANDS_FLAGS ?= --clangd .PHONY: compile-commands -compile-commands: $(BUILDDEPS) +compile-commands: $(COMPILE_COMMANDS_PATH) +%/compile_commands.json: $(BUILDDEPS) $(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \ "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands $(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(COMPILE_COMMANDS_FLAGS) $(BINDIR) \ - > $(COMPILE_COMMANDS_PATH) + > $@ ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container