Small clean up of the Makefile

CFG_DEV is replaced by BUILD_TYPE. Debug build is fixed,
set BUILD_TYPE to Debug to make a debug build.

Add an option to compile with sanitizers.
This commit is contained in:
Yuxuan Shui 2018-05-21 14:25:56 +01:00
parent 7844634853
commit 9b24550814
1 changed files with 8 additions and 7 deletions

View File

@ -110,15 +110,16 @@ CFG += -DCOMPTON_VERSION="\"$(COMPTON_VERSION)\""
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
ifeq "$(CFG_DEV)" ""
BUILD_TYPE ?= "Debug"
ifeq "$(BUILD_TYPE)" "Release"
CFLAGS ?= -DNDEBUG -O2 -D_FORTIFY_SOURCE=2
else
CC = clang
export LD_ALTEXEC = /usr/bin/ld.gold
OBJS += backtrace-symbols.o
LIBS += -lbfd
else ifeq "$(BUILD_TYPE)" "Debug"
CFLAGS += -ggdb -Wshadow
# CFLAGS += -Weverything -Wno-disabled-macro-expansion -Wno-padded -Wno-gnu
endif
ifeq "$(ENABLE_SAN)" "1"
CFLAGS += -fsanitize=address,undefined
endif
LIBS += $(shell pkg-config --libs $(PACKAGES))