aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-10-13 19:37:12 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-10-13 19:37:12 -0400
commitb6440b2be8ee8069ed050ba61ee9767f9fb04c2f (patch)
treebc36600d330918d4100220741cb84f0ec7ba7cae /Makefile
parent981217b98220f7dc94c70fd6f4b7078ecca6020b (diff)
downloadlibctemplates-b6440b2be8ee8069ed050ba61ee9767f9fb04c2f.tar.gz
libctemplates-b6440b2be8ee8069ed050ba61ee9767f9fb04c2f.tar.bz2
libctemplates-b6440b2be8ee8069ed050ba61ee9767f9fb04c2f.zip
Added DEBUG=true flag to makefile
When compileing with DEBUG=true, gcc will build with no optimizations and with debugging symbols. When compileing without DEBUG=true, gcc with build with -O3 and no debugging symbols.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 88e0e9d..763a2e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,13 @@
-CFLAGS = -I. -L. -std=c99 -pedantic -Wall -Werror -O3 -g
-CC = gcc
+CFLAGS = -I. -L. -std=c99 -pedantic
+CC?=gcc
LIBNAME = libctemplates.a
BIN_POSTFIX = .exe
+ifeq ($(DEBUG),true)
+ CFLAGS += -g -O0 -Wall -Werror
+else
+ CFLAGS += -03
+endif
TEST_1_NAME = t/test_1$(BIN_POSTFIX)