]> Pileus Git - wmpus/blob - makefile
Add home grown wayland protocol
[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),gwl)
14 GCC       ?= gcc
15 PROG      ?= wmpus
16
17 sys-gwl.o: CFLAGS  += $(shell pkg-config --cflags gtk+-3.0) -I.
18 wmpus:     LDFLAGS += $(shell pkg-config --libs   gtk+-3.0)
19 endif
20
21 ifeq ($(SYS),x11)
22 GCC       ?= gcc
23 PROG      ?= wmpus
24 LDFLAGS   += -lX11 -lXinerama
25 endif
26
27 ifeq ($(SYS),win32)
28 GCC       ?= i486-mingw32-gcc
29 PROG      ?= wmpus.exe
30 LDFLAGS   += -lgdi32
31 endif
32
33 all: $(PROG)
34
35 clean:
36         rm -f wmpus *.exe *.o
37
38 dist:
39         tar -czf wmpus-$(VERSION).tar.gz --transform s::wmpus-$(VERSION)/: \
40                 README LICENSE config.mk.example makefile *.1 *.c *.h
41
42 install: all
43         sed -i 's:/usr.*:$(PREFIX)/bin/wmpus:' wmpus.session
44         install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
45         install -m 644 -D wmpus.1 $(DESTDIR)$(MANPREFIX)/man1/wmpus.1
46         install -m 755 -D wmpus.session $(DESTDIR)/etc/X11/Sessions/wmpus
47         install -m 644 -D wmpus.desktop $(DESTDIR)$(PREFIX)/share/xsessions/wmpus.desktop
48
49 uninstall:
50         rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
51         rm -f $(DESTDIR)$(MANPREFIX)/man1/wmpus.1
52
53 $(PROG): main.o conf.o util.o sys-$(SYS).o wm-$(WM).o
54         $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
55
56 %.o: %.c $(wildcard *.h) makefile
57         $(GCC) $(CFLAGS) --std=gnu99 -c -o $@ $<
58
59 .PHONY: all clean dist install uninstall