5 LIBS = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-randr
6 CFLAGS += -std=c99 -pedantic -Wall -Wextra -I$(PREFIX)/include
7 CFLAGS += -D_POSIX_C_SOURCE=200112L -DVERSION=\"$(VERSION)\"
8 LDFLAGS += -L$(PREFIX)/lib
11 BINPREFIX = $(PREFIX)/bin
12 MANPREFIX = $(PREFIX)/share/man
13 CPLPREFIX = $(PREFIX)/share/bash-completion/completions
15 WM_SRC = bspwm.c events.c messages.c ewmh.c settings.c helpers.c tree.c types.c rules.c window.c
16 WM_OBJ = $(WM_SRC:.c=.o)
17 CL_SRC = bspc.c helpers.c
18 CL_OBJ = $(CL_SRC:.c=.o)
24 debug: CFLAGS += -O0 -g -DDEBUG
29 $(WM_OBJ) $(CL_OBJ): Makefile
32 $(CC) $(CFLAGS) -c -o $@ $<
35 $(CC) -o $@ $(WM_OBJ) $(LDFLAGS) $(LIBS)
38 $(CC) -o $@ $(CL_OBJ) $(LDFLAGS) $(LIBS)
41 mkdir -p "$(DESTDIR)$(BINPREFIX)"
42 cp -p bsp{wm,c} "$(DESTDIR)$(BINPREFIX)"
43 mkdir -p "$(DESTDIR)$(MANPREFIX)"/man1
44 cp -Pp bsp{wm,c}.1 "$(DESTDIR)$(MANPREFIX)"/man1
45 mkdir -p "$(DESTDIR)$(CPLPREFIX)"
46 cp -p bash_completion "$(DESTDIR)$(CPLPREFIX)"/bspc
49 rm -f "$(DESTDIR)$(BINPREFIX)"/bsp{wm,c}
50 rm -f "$(DESTDIR)$(MANPREFIX)"/man1/bsp{wm,c}.1
51 rm -f "$(DESTDIR)$(CPLPREFIX)"/bspc
54 pandoc --no-wrap -t json doc/README.md | runhaskell doc/man_filter.hs | pandoc --no-wrap -f json -t man --template doc/man.template -V name=$(NAME) -o $(NAME).1
55 pandoc --no-wrap -f markdown -t asciidoc doc/README.md -o README.asciidoc
56 patch -p 1 -i doc/quirks.patch
59 rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c}
61 .PHONY: all debug install uninstall doc clean