aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/makefile b/makefile
index 8e7686a..429dd50 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,6 @@
# Header in which assert(x) is defined
+CM_OPT_RELEASE ?= 0
+CM_OPT_CC_FLAGS ?=
CM_OPT_ASSERT_PATH ?= <assert.h>
CC ?= gcc
@@ -10,9 +12,16 @@ CM_OBJECT := $(CM_SOURCE:.c=.o)
CM_DEPEND := $(CM_SOURCE:.c=.d)
CM_CC_FLAGS := \
- -Wall -Wextra -pedantic \
+ -Wall -Wextra \
-MMD -MP -I$(CM_DIR)
+ifeq ($(CM_OPT_RELEASE),1)
+ CM_CC_FLAGS += -O2 -fno-stack-protector
+else
+ CM_CC_FLAGS += -g3
+endif
+
+CM_CC_FLAGS += $(CM_OPT_CC_FLAGS)
CM_CC_FLAGS += -DCM_OPT_ASSERT_PATH='$(CM_OPT_ASSERT_PATH)'
.PHONY: all
@@ -25,4 +34,4 @@ $(CM_OBJECT): $(CM_SOURCE)
clean::
$(RM) $(CM_OBJECT) $(CM_DEPEND)
--include $(CM_DEPEND) \ No newline at end of file
+-include $(CM_DEPEND)