4 LIBS = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama
5 CFLAGS = -std=c99 -pedantic -Wall -Wextra
9 BINPREFIX = $(PREFIX)/bin
11 WM_SRC = bspwm.c events.c messages.c ewmh.c settings.c helpers.c tree.c types.c rules.c window.c
12 CL_SRC = bspc.c helpers.c
14 WM_OBJ = $(WM_SRC:.c=.o)
15 CL_OBJ = $(CL_SRC:.c=.o)
19 all: options bspwm bspc
21 debug: CFLAGS += -O0 -g -DDEBUG
22 debug: options bspwm bspc
25 @echo "bspwm build options:"
27 @echo "CFLAGS = $(CFLAGS)"
28 @echo "LDFLAGS = $(LDFLAGS)"
29 @echo "PREFIX = $(PREFIX)"
33 @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
37 @$(CC) -o $@ $(WM_OBJ) $(LDFLAGS)
41 @$(CC) -o $@ $(CL_OBJ) $(LDFLAGS)
45 @rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c}
48 @echo "installing executable files to $(DESTDIR)$(BINPREFIX)"
49 @install -D -m 755 bspwm $(DESTDIR)$(BINPREFIX)/bspwm
50 @install -D -m 755 bspc $(DESTDIR)$(BINPREFIX)/bspc
53 @echo "removing executable files from $(DESTDIR)$(BINPREFIX)"
54 @rm -f $(DESTDIR)$(BINPREFIX)/bsp{wm,c}
56 .PHONY: all debug options clean install uninstall