make better debug build rule

This commit is contained in:
PoliEcho 2025-03-12 16:57:35 +01:00
parent 925b42ceb7
commit 941bbcdb5b

View File

@ -1,8 +1,7 @@
# Compiler and flags
CPPC = g++
CPPC_FLAGS = -std=c++23 -s -O3 -lncursesw -lcurl -lmenu -lpanel -Wall -Wextra -Wno-write-strings
# Debug flags:
# CPPC_FLAGS = -ggdb -std=c++23 -lncursesw -lcurl -lmenu -lpanel -Wall -Wextra -Wno-write-strings
DEBUG_FLAGS = -ggdb -std=c++23 -lncursesw -lcurl -lmenu -lpanel -Wall -Wextra -Wno-write-strings
SRC_PATH := src
@ -11,16 +10,18 @@ BIN_PATH := build/bin
SRC_FILES := $(shell find $(SRC_PATH) -name '*.cpp')
# Generate corresponding object file paths by replacing src/ with build/obj/
OBJ_FILES := $(patsubst $(SRC_PATH)/%.cpp,$(OBJ_PATH)/%.o,$(SRC_FILES))
all: make-build-dir $(BIN_PATH)/bakatui
debug: CPPC_FLAGS = $(DEBUG_FLAGS)
debug: make-build-dir $(BIN_PATH)/bakatui
make-build-dir:
mkdir -p $(OBJ_PATH)
mkdir -p $(OBJ_PATH)/marks
mkdir -p $(BIN_PATH)
@ -35,4 +36,4 @@ $(OBJ_PATH)/%.o: $(SRC_PATH)/%.cpp
clean:
rm -fr build
.PHONY: all clean install
.PHONY: all clean install debug