From 676f27c094217be97decec0ab0658fa652330a88 Mon Sep 17 00:00:00 2001 From: Quinn Date: Mon, 13 Jan 2025 00:14:52 +0100 Subject: [PATCH] make compile_commands.json when opening directory --- .gitignore | 1 + .vscode/tasks.json | 12 ++++++++++-- makefile | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8a116e3..ce73eaa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ !.vscode/launch.json bin obj +compile_commands.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cd90c8d..cdbd550 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,4 +1,5 @@ { + "version": "2.0.0", "tasks": [ { "type": "shell", @@ -47,7 +48,14 @@ "isDefault": false }, "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" + ] } diff --git a/makefile b/makefile index 6eefba3..2bde6a2 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,8 @@ SRC = $(wildcard src/*.c) $(wildcard src/**/*.c) $(wildcard src/**/**/*.c) $(wil OBJ = $(patsubst src/%,$(DIR_OBJ)/$(ARCH)/%,$(SRC:.c=.o)) TARGET = $(DIR_BIN)/$(ARCH)/$(NAME)$(EXT) +all: linux-x86_64 win-x86_64 web + clean: rm -rf $(DIR_BIN) $(DIR_OBJ)