[stgt] [PATCH] DEBUG mode in Makefile

Alexander Nezhinsky alexandern at Voltaire.COM
Tue Nov 30 16:12:21 CET 2010


Added DEBUG symbol for Makefile. If defined in the command line as DEBUG=1
it turns off the optimizations, makes the binary (thru the compilation flags)
to include line info and to be gdb-friendly.

Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
---
 usr/Makefile |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/usr/Makefile b/usr/Makefile
index 322ecfb..a138f98 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -50,7 +50,12 @@ INCLUDES += -I.
 
 CFLAGS += -D_GNU_SOURCE
 CFLAGS += $(INCLUDES)
-CFLAGS += -g -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC
+ifneq ($(DEBUG),)
+CFLAGS += -g -O0 -ggdb -rdynamic
+else
+CFLAGS += -g -O2 -fno-strict-aliasing
+endif
+CFLAGS += -Wall -Wstrict-prototypes -fPIC
 CFLAGS += -DTGT_VERSION=\"$(VERSION)$(EXTRAVERSION)\"
 
 LIBS += -lpthread
--
1.7.3
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list