From e66c6110383baa3510ced5b9f5e322465f769b9c Mon Sep 17 00:00:00 2001 From: Max Wash Date: Mon, 13 Mar 2023 21:41:33 +0000 Subject: [PATCH] build: store compile_commands.json in source tree .config dir --- Makefile | 3 ++- tools/make/generate_compile_commands.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 79b59dd..87a5d9d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ ROOT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH))) include tools/make/gcc-cross-compile.mk BUILD_DIR := build +CONFIG_DIR := .config #################################### # Architecture-specific source files @@ -67,7 +68,7 @@ clean: @printf " \033[1;93mRM\033[0m Deleting build files.\n" @rm -rf $(BUILD_DIR) -$(BUILD_DIR)/compile_commands.json: +$(CONFIG_DIR)/compile_commands.json: @printf " \033[1;93mGEN\033[0m Generating compiler database.\n" @./tools/make/generate_compile_commands.py diff --git a/tools/make/generate_compile_commands.py b/tools/make/generate_compile_commands.py index f7c2ac9..161ddeb 100755 --- a/tools/make/generate_compile_commands.py +++ b/tools/make/generate_compile_commands.py @@ -55,6 +55,6 @@ for line in make_output_lines: os.system('make') -out_file = open('build/compile_commands.json', 'w') +out_file = open('.config/compile_commands.json', 'w') json.dump(compile_db, out_file, indent=4)