summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--log.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7bc8857..120bc58 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,10 @@ LDFLAGS ?=
CCQ = @echo -e " CC\t$<" && $(CC)
LDQ = @echo -e " LD\t$@" && $(CC)
+ifeq ($(DEBUG), 1)
+ CFLAGS += -g -DDEBUG
+endif
+
all: $(P)
$(P): $(OBJS)
diff --git a/log.h b/log.h
index d8dfe59..03b77dc 100644
--- a/log.h
+++ b/log.h
@@ -24,5 +24,10 @@
#define log_err(fmt, args...) fprintf(stderr, "Error: " fmt, ##args)
#define log_warn(fmt, args...) fprintf(stderr, "Warning: " fmt, ##args)
#define log_info(fmt, args...) fprintf(stdout, fmt, ##args)
+#ifdef DEBUG
+# define log_dbg(fmt, args...) fprintf(stdout, fmt, ##args)
+#else
+# define log_dbg(fmt, args...)
+#endif
#endif /* LOG_H */