From 0043b907a776c6cc1a0e08baae09886632e7419f Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Wed, 7 Apr 2021 01:40:05 +0200 Subject: [PATCH] Small improvement to Makefile. --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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)