]> Pileus Git - wmpus/blob - makefile
Various icccm and ewmh properties
[wmpus] / makefile
1 # wmpus - cross platofrm window manager
2 # See LICENSE file for copyright and license details.
3
4 -include config.mk
5
6 VERSION   ?= 0.1-rc1
7 WM        ?= wmii
8 SYS       ?= x11
9 CFLAGS    ?= -g -Wall
10 PREFIX    ?= /usr/local
11 MANPREFIX ?= ${PREFIX}/share/man
12
13 ifeq ($(SYS),xcb)
14 GCC       ?= gcc
15 PROG      ?= wmpus
16 LDFLAGS   += -lxcb -lxcb-keysyms -lxcb-util -lxcb-icccm -lxcb-ewmh -lxcb-xinerama
17 endif
18
19 ifeq ($(SYS),xlib)
20 GCC       ?= gcc
21 PROG      ?= wmpus
22 LDFLAGS   += -lX11 -lXinerama
23 endif
24
25 ifeq ($(SYS),win32)
26 GCC       ?= mingw32-gcc
27 PROG      ?= wmpus.exe
28 LDFLAGS   += -lgdi32
29 endif
30
31 all: $(PROG)
32
33 clean:
34         rm -f wmpus *.exe *.o
35
36 dist:
37         tar -czf wmpus-$(VERSION).tar.gz --transform s::wmpus-$(VERSION)/: \
38                 README LICENSE config.mk.example makefile *.1 *.c *.h
39
40 install: all
41         sed -i 's:/usr.*:$(PREFIX)/bin/wmpus:' wmpus.session
42         install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
43         install -m 644 -D wmpus.1 $(DESTDIR)$(MANPREFIX)/man1/wmpus.1
44         install -m 755 -D wmpus.session $(DESTDIR)/etc/X11/Sessions/wmpus
45         install -m 644 -D wmpus.desktop $(DESTDIR)$(PREFIX)/share/xsessions/wmpus.desktop
46
47 uninstall:
48         rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
49         rm -f $(DESTDIR)$(MANPREFIX)/man1/wmpus.1
50
51 $(PROG): main.o conf.o util.o sys-$(SYS).o wm-$(WM).o
52         $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
53
54 %.o: %.c $(wildcard *.h) makefile
55         $(GCC) $(CFLAGS) --std=gnu99 -c -o $@ $<
56
57 .PHONY: all clean dist install uninstall