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

Merge pull request #20716 from kfessel/f-make-compile-commads

Makefile.include: place compile_commands.json by rule target
This commit is contained in:
Marian Buschsieweke 2024-05-31 12:08:08 +00:00 committed by GitHub
commit 2ef8b21ea2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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