From 36ce2de3f5dfd8cc363ed561511fb6400dfa9c0d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 6 Dec 2011 21:31:01 +0000 Subject: [PATCH] add a "make debug" option --- daemon/Makefile | 12 +++++++++++- daemon/call.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/daemon/Makefile b/daemon/Makefile index c921e60a7..aa76fecbb 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -7,12 +7,19 @@ CFLAGS= -g -Wall `pkg-config --cflags glib-2.0` `pcre-config --cflags` -fno-str CFLAGS+= -I/lib/modules/`uname -r`/build/include/ -I../kernel-module/ CFLAGS+= -D_GNU_SOURCE CFLAGS+= -O2 + ifeq ($(REDIS),yes) CFLAGS+= -I$(LIBREDISDIR) else CFLAGS+= -DNO_REDIS=1 endif + +ifeq ($(DBG),yes) +CFLAGS+= -D__DEBUG=1 +endif + LDFLAGS= `pkg-config --libs glib-2.0` `pcre-config --libs` + ifeq ($(REDIS),yes) LDFLAGS+= -L$(LIBREDISDIR) -lhiredis -luuid endif @@ -25,7 +32,7 @@ endif OBJS= $(SRCS:.c=.o) -.PHONY: all dep clean tests no-redis +.PHONY: all dep clean tests no-redis debug all: ifeq ($(REDIS),yes) @@ -36,6 +43,9 @@ endif no-redis: make REDIS=no all +debug: + make DBG=yes all + tests: make aux-test poller-test diff --git a/daemon/call.c b/daemon/call.c index 3b5ecde8b..7289e9a89 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -27,7 +27,7 @@ -#if 0 +#ifdef __DEBUG #define DBG(x...) mylog(LOG_DEBUG, x) #else #define DBG(x...) ((void)0)