From f4704f51a5ecce3362895218002f304408eceff1 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Mon, 31 Oct 2022 17:13:46 -0500 Subject: add debug opts to makefile, fix munmap error --- makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 8f28203..7bef8d1 100644 --- a/makefile +++ b/makefile @@ -15,10 +15,16 @@ so_minor := 1 CC=gcc -CFLAGS = -Wall -pedantic $(debug) +CFLAGS = -Wall -pedantic $(debug) $(opt) LDFLAGS := -lhts -lm -fPIC -# debug = -fsanitize=address -O2 -g + +ifeq ($(DEBUG),"1") + debug = -fsanitize=address -g +else + opt = -O2 +endif + SRC_EXT:=%.c _STD_BUILD=$(CC) $(CFLAGS) $(filter $(SRC_EXT) %.o, $^) -o $@ -- cgit v1.2.3