Makefile: add 'make debug'
authorBrian Norris <banorris@uci.edu>
Sat, 26 May 2012 01:35:27 +0000 (18:35 -0700)
committerBrian Norris <banorris@uci.edu>
Sat, 26 May 2012 03:39:00 +0000 (20:39 -0700)
This is sort of hacky, but it works! Now (after cleaning), you can recompile
with 'make debug' to enable my debugging features (not Subramanian's).

Makefile
common.h

index ef89c5a7e9d924ee97cf5560e32b5e29c5afeadb..de9051cfda92d7d75e1ef4e1b7fbaf6448a3d3e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,9 @@ LDFLAGS=-ldl -lrt
 
 all: $(BIN)
 
+debug: CPPFLAGS += -DCONFIG_DEBUG
+debug: all
+
 $(BIN): $(USER_O) $(LIB_SO)
        $(CXX) -o $(BIN) $(USER_O) -L. -l$(LIB_NAME)
 
index cd6b16a286cf4684f711a824b303a465a99c590c..656ea3798dde73d08b168fdfe54f5d4c72dcc04d 100644 (file)
--- a/common.h
+++ b/common.h
@@ -3,7 +3,11 @@
 
 #include <stdio.h>
 
-//#define CONFIG_DEBUG
+/*
+#ifndef CONFIG_DEBUG
+#define CONFIG_DEBUG
+#endif
+*/
 
 #ifdef CONFIG_DEBUG
 #define DEBUG(fmt, ...) do { printf("*** %25s(): line %-4d *** " fmt, __func__, __LINE__, ##__VA_ARGS__); } while (0)