]> git.lizzy.rs Git - bspwm.git/blobdiff - Makefile
Handle optional desktop name in 'list'
[bspwm.git] / Makefile
index 60342302be97ece140b5e2163ff244770561307e..ecfc7db16da678ff5b8050473c171ff6c555bd4b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,27 @@
-VERSION = 0.01
+VERSION = 0.2
 
-CC = gcc
-LIBS    = `pkg-config --libs xcb lua`
-CFLAGS  = -g -std=c99 -pedantic -Wall -Wextra
+CC      = gcc
+LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama
+CFLAGS  = -std=c99 -pedantic -Wall -Wextra -DVERSION=\"$(VERSION)\"
 LDFLAGS = $(LIBS)
 
-PREFIX ?= /usr/local
+PREFIX    ?= /usr/local
 BINPREFIX = $(PREFIX)/bin
+MANPREFIX = $(PREFIX)/share/man
 
-WM_SRC = bspwm.c events.c luautils.c messages.c settings.c utils.c tree.c
-CL_SRC = bspc.c
+WM_SRC = bspwm.c events.c messages.c ewmh.c settings.c helpers.c tree.c types.c rules.c window.c
+CL_SRC = bspc.c helpers.c
 
 WM_OBJ = $(WM_SRC:.c=.o)
 CL_OBJ = $(CL_SRC:.c=.o)
 
+all: CFLAGS += -Os
+all: LDFLAGS += -s
 all: options bspwm bspc
 
+debug: CFLAGS += -O0 -g -DDEBUG
+debug: options bspwm bspc
+
 options:
        @echo "bspwm build options:"
        @echo "CC      = $(CC)"
@@ -27,11 +33,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)
 
@@ -39,13 +45,17 @@ clean:
        @echo "cleaning"
        @rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c}
 
-install: all
+install:
        @echo "installing executable files to $(DESTDIR)$(BINPREFIX)"
        @install -D -m 755 bspwm $(DESTDIR)$(BINPREFIX)/bspwm
        @install -D -m 755 bspc $(DESTDIR)$(BINPREFIX)/bspc
+       @echo "installing manual page to $(DESTDIR)$(MANPREFIX)/man1"
+       @install -D -m 644 bspwm.1 $(DESTDIR)$(MANPREFIX)/man1/bspwm.1
 
 uninstall:
        @echo "removing executable files from $(DESTDIR)$(BINPREFIX)"
        @rm -f $(DESTDIR)$(BINPREFIX)/bsp{wm,c}
+       @echo "removing manual page from $(DESTDIR)$(MANPREFIX)/man1"
+       @rm -f $(DESTDIR)$(MANPREFIX)/man1/bspwm.1
 
-.PHONY: all options clean install uninstall
+.PHONY: all debug options clean install uninstall