make compile_commands.json when opening directory

This commit is contained in:
2025-01-13 00:14:52 +01:00
parent d3585ada15
commit 676f27c094
3 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
!.vscode/launch.json !.vscode/launch.json
bin bin
obj obj
compile_commands.json

12
.vscode/tasks.json vendored
View File

@@ -1,4 +1,5 @@
{ {
"version": "2.0.0",
"tasks": [ "tasks": [
{ {
"type": "shell", "type": "shell",
@@ -47,7 +48,14 @@
"isDefault": false "isDefault": false
}, },
"detail": "builds the program for web using emscripten" "detail": "builds the program for web using emscripten"
},
{
"label": "create compile_commands.json",
"type": "shell",
"command": "bear -- make",
"runOptions": {
"runOn": "folderOpen"
}
} }
], ]
"version": "2.0.0"
} }

View File

@@ -12,6 +12,8 @@ SRC = $(wildcard src/*.c) $(wildcard src/**/*.c) $(wildcard src/**/**/*.c) $(wil
OBJ = $(patsubst src/%,$(DIR_OBJ)/$(ARCH)/%,$(SRC:.c=.o)) OBJ = $(patsubst src/%,$(DIR_OBJ)/$(ARCH)/%,$(SRC:.c=.o))
TARGET = $(DIR_BIN)/$(ARCH)/$(NAME)$(EXT) TARGET = $(DIR_BIN)/$(ARCH)/$(NAME)$(EXT)
all: linux-x86_64 win-x86_64 web
clean: clean:
rm -rf $(DIR_BIN) $(DIR_OBJ) rm -rf $(DIR_BIN) $(DIR_OBJ)