Skip to content

Commit b58b255

Browse files
committed
Makefile.include: place compile_commands.json by rule target
1 parent 095bc34 commit b58b255

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile.include

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,12 @@ endif # BUILDOSXNATIVE
718718
COMPILE_COMMANDS_PATH ?= $(if $(findstring $(RIOTBASE),$(APPDIR)),$(RIOTBASE)/compile_commands.json, $(APPDIR)/compile_commands.json)
719719
COMPILE_COMMANDS_FLAGS ?= --clangd
720720
.PHONY: compile-commands
721-
compile-commands: $(BUILDDEPS)
721+
compile-commands: $(COMPILE_COMMANDS_PATH)
722+
%/compile_commands.json: $(BUILDDEPS)
722723
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
723724
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands
724725
$(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(COMPILE_COMMANDS_FLAGS) $(BINDIR) \
725-
> $(COMPILE_COMMANDS_PATH)
726+
> $@
726727

727728
ifeq ($(BUILD_IN_DOCKER),1)
728729
link: ..in-docker-container

0 commit comments

Comments
 (0)