feat: Build optimizations
This commit is contained in:
5
makefile
5
makefile
@@ -1,5 +1,5 @@
|
||||
CC=g++
|
||||
C_FLAGS=-g -Wall -Wextra -O0 -Wno-unused-function
|
||||
C_FLAGS=-g -Wall -Wextra -O0 -Wno-unused-function -MMD -MP
|
||||
VAL_FLAGS=--leak-check=full --show-leak-kinds=all --track-origins=yes -s
|
||||
|
||||
DIR_SRC=src
|
||||
@@ -11,6 +11,7 @@ OUTBIN=$(DIR_BUILD)/bin/main
|
||||
|
||||
SRCS=$(shell find $(DIR_SRC)/ -type f -name '*.cpp')
|
||||
OBJS=$(patsubst $(DIR_SRC)/%.cpp,$(DIR_BUILD)/obj/%.o,$(SRCS))
|
||||
DEPMF=$(patsubst $(DIR_SRC)/%.cpp,$(DIR_BUILD)/obj/%.d,$(SRCS))
|
||||
|
||||
DEPS_EXT=$(patsubst %,-l%,$(DEPS))
|
||||
INCS_EXT=$(patsubst %,-I%,$(DIR_INC))
|
||||
@@ -38,6 +39,8 @@ $(DIR_BUILD)/obj/%.o: $(DIR_SRC)/%.cpp
|
||||
@mkdir -p $(@D)
|
||||
$(CC) $(C_FLAGS) $(INCS_EXT) -c $< -o $@
|
||||
|
||||
-include $(DEPMF)
|
||||
|
||||
dbg: $(DBG_BIN)
|
||||
gdb $(GDB_FLAGS) ./$(OUTBIN)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user