From 0ce0c0d9d0d11ec9542d3bdd93959dbb9339d330 Mon Sep 17 00:00:00 2001 From: CK Tan Date: Tue, 19 Feb 2019 15:52:01 -0800 Subject: [PATCH] handle make DEBUG=1 --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 695291f..476b044 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,13 @@ CC = gcc CFILES = toml.c CFLAGS = -std=c99 -Wall -Wextra -CFLAGS += -O2 -DNDEBUG -#CFLAGS += -O0 -g +# to compile for debug: make DEBUG=1 +# to compile for no debug: make +ifdef DEBUG + CFLAGS += -O0 -g +else + CFLAGS += -O2 -DNDEBUG +endif EXEC = toml_json toml_cat