From 2dd61aba49de0f6513c858868625801544e8f031 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 Apr 2022 23:46:55 +0200 Subject: [PATCH] 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. --- capture/build/unix/Makefile | 6 +++++- csvexport/build/unix/Makefile | 6 +++++- import-chrome/build/unix/Makefile | 6 +++++- library/unix/Makefile | 6 +++++- profiler/build/unix/Makefile | 6 +++++- update/build/unix/Makefile | 6 +++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/capture/build/unix/Makefile b/capture/build/unix/Makefile index c70c51dd..035eda1b 100644 --- a/capture/build/unix/Makefile +++ b/capture/build/unix/Makefile @@ -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 diff --git a/csvexport/build/unix/Makefile b/csvexport/build/unix/Makefile index c70c51dd..035eda1b 100644 --- a/csvexport/build/unix/Makefile +++ b/csvexport/build/unix/Makefile @@ -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 diff --git a/import-chrome/build/unix/Makefile b/import-chrome/build/unix/Makefile index c70c51dd..035eda1b 100644 --- a/import-chrome/build/unix/Makefile +++ b/import-chrome/build/unix/Makefile @@ -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 diff --git a/library/unix/Makefile b/library/unix/Makefile index c70c51dd..a657b17b 100644 --- a/library/unix/Makefile +++ b/library/unix/Makefile @@ -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 diff --git a/profiler/build/unix/Makefile b/profiler/build/unix/Makefile index c70c51dd..035eda1b 100644 --- a/profiler/build/unix/Makefile +++ b/profiler/build/unix/Makefile @@ -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 diff --git a/update/build/unix/Makefile b/update/build/unix/Makefile index c70c51dd..035eda1b 100644 --- a/update/build/unix/Makefile +++ b/update/build/unix/Makefile @@ -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