]> git.lizzy.rs Git - bspwm.git/blobdiff - Makefile
Add new contributor
[bspwm.git] / Makefile
index 386c77ec21cb16b65bdd5473c1bac1fa45c7c8bb..c13b887075f076a11e7eec612b3da9c481ad97e4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,56 +1,59 @@
-VERSION = 0.1
+VERSION = 0.7
 
 CC      = gcc
-LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama
-CFLAGS  = -std=c99 -pedantic -Wall -Wextra
-LDFLAGS = $(LIBS)
+LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-randr
+CFLAGS  += -std=c99 -pedantic -Wall -Wextra -I$(PREFIX)/include
+CFLAGS  += -D_POSIX_C_SOURCE=200112L -DVERSION=\"$(VERSION)\"
+LDFLAGS += -L$(PREFIX)/lib
 
 PREFIX    ?= /usr/local
 BINPREFIX = $(PREFIX)/bin
+MANPREFIX = $(PREFIX)/share/man
+CPLPREFIX = $(PREFIX)/share/bash-completion/completions
 
 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_SRC = bspc.c helpers.c
 CL_OBJ = $(CL_SRC:.c=.o)
 
 all: CFLAGS += -Os
 all: LDFLAGS += -s
-all: options bspwm bspc
+all: bspwm bspc
 
 debug: CFLAGS += -O0 -g -DDEBUG
-debug: options bspwm bspc
+debug: bspwm bspc
 
-options:
-       @echo "bspwm build options:"
-       @echo "CC      = $(CC)"
-       @echo "CFLAGS  = $(CFLAGS)"
-       @echo "LDFLAGS = $(LDFLAGS)"
-       @echo "PREFIX  = $(PREFIX)"
+include Sourcedeps
+
+$(WM_OBJ) $(CL_OBJ): Makefile
 
 .c.o:
-       @echo "CC $<"
-       @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
+       $(CC) $(CFLAGS) -c -o $@ $<
 
 bspwm: $(WM_OBJ)
-       @echo CC -o $@
-       @$(CC) -o $@ $(WM_OBJ) $(LDFLAGS)
+       $(CC) -o $@ $(WM_OBJ) $(LDFLAGS) $(LIBS)
 
 bspc: $(CL_OBJ)
-       @echo CC -o $@
-       @$(CC) -o $@ $(CL_OBJ) $(LDFLAGS)
-
-clean:
-       @echo "cleaning"
-       @rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c}
+       $(CC) -o $@ $(CL_OBJ) $(LDFLAGS) $(LIBS)
 
 install:
-       @echo "installing executable files to $(DESTDIR)$(BINPREFIX)"
-       @install -D -m 755 bspwm $(DESTDIR)$(BINPREFIX)/bspwm
-       @install -D -m 755 bspc $(DESTDIR)$(BINPREFIX)/bspc
+       mkdir -p "$(DESTDIR)$(BINPREFIX)"
+       cp -p bsp{wm,c} "$(DESTDIR)$(BINPREFIX)"
+       mkdir -p "$(DESTDIR)$(MANPREFIX)"/man1
+       cp -Pp doc/bsp{wm,c}.1 "$(DESTDIR)$(MANPREFIX)"/man1
+       mkdir -p "$(DESTDIR)$(CPLPREFIX)"
+       cp -p bash_completion "$(DESTDIR)$(CPLPREFIX)"/bspc
 
 uninstall:
-       @echo "removing executable files from $(DESTDIR)$(BINPREFIX)"
-       @rm -f $(DESTDIR)$(BINPREFIX)/bsp{wm,c}
+       rm -f "$(DESTDIR)$(BINPREFIX)"/bsp{wm,c}
+       rm -f "$(DESTDIR)$(MANPREFIX)"/man1/bsp{wm,c}.1
+       rm -f "$(DESTDIR)$(CPLPREFIX)"/bspc
+
+doc:
+       a2x -v -d manpage -f manpage -a revnumber=$(VERSION) doc/bspwm.1.txt
+       cat doc/header.txt doc/bspwm.1.txt > README.asciidoc
+
+clean:
+       rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c}
 
-.PHONY: all debug options clean install uninstall
+.PHONY: all debug install uninstall doc clean