added make target debug
This commit is contained in:
1 parent
2c17c15472
commit
f2e8055172
3 files changed
+99
-62
No files matched your search
@@ -30,6 +30,8 @@ WCC := -Wconversion \
|
||||
-Wshadow \
|
||||
-Wpointer-arith
|
||||
|
||||
DEBUG_FLAGS := -O0 -g3
|
||||
|
||||
C_DEF :=
|
||||
|
||||
C_SRC := main.c \
|
||||
@@ -39,6 +41,7 @@ C_SRC := main.c \
|
||||
C_FLAGS := -std=c11 \
|
||||
$(WG) \
|
||||
$(WCC) \
|
||||
$(DEBUG_FLAGS) \
|
||||
$(addprefix -I, $(INC_DIR)) \
|
||||
$(addprefix -D, $(C_DEF))
|
||||
|
||||
@@ -50,6 +53,8 @@ LD_FLAGS := $(addprefix -l, $(LIB)) \
|
||||
OBJ := $(addprefix $(OBJ_DIR)/, $(C_SRC:.c=.o))
|
||||
BIN := $(BIN_DIR)/$(NAME)
|
||||
|
||||
GDBINIT := ./.gdbinit
|
||||
|
||||
# the flags file is required for `clangd` (lsp client)
|
||||
FLAGS_FILE := ./compile_flags.txt
|
||||
|
||||
@@ -114,3 +119,6 @@ test: $(BIN)
|
||||
-A \
|
||||
~/repositories/test-projects/zig/
|
||||
|
||||
debug: $(BIN)
|
||||
$(GDB) --command=$(GDBINIT) $<
|
||||
|
||||
Reference in new issue
Block a user