Add DEBUG and NDEBUG preprocessor defines

This commit is contained in:
BlackMark 2020-07-03 20:53:06 +02:00
parent 3109678551
commit 51bd0c5621

View File

@ -168,8 +168,11 @@ CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-
CXXFLAGS = $(MCU) $(CXX_DEFS) $(CXX_INCLUDES) $(OPT) -Wall -Wextra -pedantic -std=c++17 -fdata-sections -ffunction-sections
ifeq ($(DEBUG), 1)
CFLAGS += -g -gdwarf-2
CXXFLAGS += -g -gdwarf-2
CFLAGS += -g -gdwarf-2 -DDEBUG
CXXFLAGS += -g -gdwarf-2 -DDEBUG
else
CFLAGS += -DNDEBUG
CXXFLAGS += -DNDEBUG
endif