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