Merge pull request #6 from c00kiemon5ter/debug

handle debug messages
This commit is contained in:
Bastien Dejean 2012-10-03 11:55:10 -07:00
commit c495a084e6
2 changed files with 14 additions and 9 deletions

View file

@ -2,7 +2,7 @@ VERSION = 0.1
CC = gcc
LIBS = -lm -lxcb -lxcb-icccm -lxcb-ewmh
CFLAGS = -g -std=c99 -pedantic -Wall -Wextra
CFLAGS = -std=c99 -pedantic -Wall -Wextra
LDFLAGS = $(LIBS)
PREFIX ?= /usr/local
@ -14,7 +14,12 @@ CL_SRC = bspc.c helpers.c
WM_OBJ = $(WM_SRC:.c=.o)
CL_OBJ = $(CL_SRC:.c=.o)
all: options clean bspwm bspc
debug: CFLAGS += -O0 -g -DDEBUG
debug: options bspwm bspc
all: CFLAGS += -Os
all: LDFLAGS += -s
all: options bspwm bspc
options:
@echo "bspwm build options:"
@ -27,11 +32,11 @@ options:
@echo "CC $<"
@$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
bspwm: $(WM_OBJ)
bspwm: $(WM_OBJ)
@echo CC -o $@
@$(CC) -o $@ $(WM_OBJ) $(LDFLAGS)
bspc: $(CL_OBJ)
bspc: $(CL_OBJ)
@echo CC -o $@
@$(CC) -o $@ $(CL_OBJ) $(LDFLAGS)

View file

@ -14,12 +14,12 @@
#define XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
#define XCB_CONFIG_WINDOW_X_Y XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
#if 1
# define PUTS(x) puts(x);
# define PRINTF(x,...) printf(x, ##__VA_ARGS__);
#ifdef DEBUG
# define PUTS(x) puts(x)
# define PRINTF(x,...) printf(x, ##__VA_ARGS__)
#else
# define PUTS(x) ;
# define PRINTF(x) ;
# define PUTS(x) ((void)0)
# define PRINTF(x,...) ((void)0)
#endif
void logmsg(FILE *, char *, va_list);