From b6440b2be8ee8069ed050ba61ee9767f9fb04c2f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 13 Oct 2018 19:37:12 -0400 Subject: 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. --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3-70-g09d2