Makefiles can now build clangd database.

Executing the "make db" will run the build process of the selected tool or
library through the bear wrapper (which has to be available in the system),
which will record the compilation parameters of each source file. This
database can be then used by VS Code to set the proper defines and find all
the required includes.

Note that database building is performed in context of the specific tool or
library. Not all tools have the same set of flags.
This commit is contained in:
Bartosz Taudul 2022-04-23 23:46:55 +02:00
parent 67ab3acbd0
commit 2dd61aba49
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
6 changed files with 30 additions and 6 deletions

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../
.PHONY: all clean debug release db

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -9,4 +9,8 @@ release:
clean:
@+make -f build.mk clean
.PHONY: all clean debug release
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db