aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2022-10-31 17:13:46 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2022-10-31 17:13:46 -0500
commit628f816a236c0c3336e6e95ae237cf4953cc897e (patch)
tree20e7354817d35a3416eeb9fdce4b0fa4954634d2 /makefile
parent71528a24e09abf1e77a7756db38490d892b4603f (diff)
downloadqidx-628f816a236c0c3336e6e95ae237cf4953cc897e.tar.xz
qidx-628f816a236c0c3336e6e95ae237cf4953cc897e.zip
add debug opts to makefile, fix munmap error
Diffstat (limited to 'makefile')
-rw-r--r--makefile10
1 files changed, 8 insertions, 2 deletions
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 $@