From 70c3b7833efcbe08999f135201119f107259026a Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 25 May 2012 18:35:27 -0700 Subject: [PATCH] Makefile: add 'make debug' 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 | 3 +++ common.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef89c5a..de9051c 100644 --- 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) diff --git a/common.h b/common.h index cd6b16a..656ea37 100644 --- a/common.h +++ b/common.h @@ -3,7 +3,11 @@ #include -//#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) -- 2.34.1