From: LoRd_MuldeR Date: Tue, 6 Apr 2021 23:40:05 +0000 (+0200) Subject: Small improvement to Makefile. X-Git-Tag: 1.0.0-beta1~18 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0043b907a776c6cc1a0e08baae09886632e7419f;p=slunkcrypt%2FSlunkCrypt.git Small improvement to Makefile. --- diff --git a/Makefile b/Makefile index 0eef015..9bc473a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ # --------------------------------------------------------------------------- DEBUG ?= 0 +NALYZE ?= 0 ASAN ?= 0 STATIC ?= 0 FLTO ?= 0 @@ -22,17 +23,17 @@ SUBDIR_LIB := libslunkcrypt # Flags # --------------------------------------------------------------------------- -CFLAGS = -I$(SUBDIR_LIB)/include -std=gnu99 -Wall -march=$(MARCH) -mtune=$(MTUNE) +CONFIG = LDFLGS = +CFLAGS = -I$(SUBDIR_LIB)/include -std=gnu99 -Wall -march=$(MARCH) -mtune=$(MTUNE) -ifeq ($(DEBUG),1) +ifneq ($(ASAN),0) + CONFIG := _a + CFLAGS += -O1 -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls +else ifneq ($(DEBUG),0) CONFIG := _g CFLAGS += -Og -g -else ifeq ($(ASAN),1) - CONFIG := _a - CFLAGS += -O1 -g -fsanitize=address -fno-omit-frame-pointer else - CONFIG := CFLAGS += -O3 -DNDEBUG ifneq ($(FLTO),0) CFLAGS += -flto -fuse-linker-plugin @@ -41,6 +42,9 @@ ifneq ($(FPGO),0) CFLAGS += -fprofile-$(FPGO) endif endif +ifneq ($(NALYZE),0) + CFLAGS += -fanalyzer +endif MACHINE := $(shell $(CC) -dumpmachine)