aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
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 $@