1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Makefile.include: place compile_commands.json by rule target

This commit is contained in:
Karl Fessel 2024-05-31 13:35:04 +02:00
parent 095bc344fe
commit b58b25516c

View File

@ -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