Skip to content
Snippets Groups Projects
Commit bd2df298 authored by Yuriy Vostrikov's avatar Yuriy Vostrikov
Browse files

[core] simplify CFLAGS handling for different build types

parent 83d35db9
No related merge requests found
......@@ -26,7 +26,7 @@ endif
ifeq ($(OS), Linux)
CFLAGS += -DLinux -D_FILE_OFFSET_BITS=64 -DEV_USE_INOTIFY -D_GNU_SOURCE
ifeq ($(DEBUG), 2)
ifdef DEBUG
CFLAGS += -DHAVE_VALGRIND
endif
endif
......@@ -35,14 +35,8 @@ ifeq (,$(filter -g%,$(CFLAGS)))
CFLAGS += -g3 -ggdb
endif
ifdef DEBUG
CFLAGS += -DDEBUG -fno-omit-frame-pointer
else
CFLAGS += -DNDEBUG
endif
ifeq (,$(filter -O%,$(CFLAGS)))
ifeq ($(DEBUG), 2)
ifdef DEBUG
CFLAGS += -O0
else
CFLAGS += -O2
......
......@@ -14,11 +14,14 @@ endif
-include $(SRCDIR)/config.mk $(SRCDIR)/scripts/config.mk
include $(SRCDIR)/scripts/config_def.mk
ifneq (,$(findstring _debug,$(OBJDIR)))
DEBUG=0
ifneq (,$(findstring _release,$(OBJDIR)))
CFLAGS += -DNDEBUG
else ifneq (,$(findstring _debug,$(OBJDIR)))
DEBUG=1
CFLAGS += -DDEBUG -fno-omit-frame-pointer
else ifneq (,$(findstring _test,$(OBJDIR)))
CFLAGS += --coverage -DCOVERAGE -DNDEBUG
else ifneq (,$(findstring_coverage,$(OBJDIR)))
else ifneq (,$(findstring _coverage,$(OBJDIR)))
CFLAGS += --coverage -DCOVERAGE
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment