X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=makefile;h=1e64c672ee7f43e6e605c4eea9e714cea15940f0;hb=03298d834be19eed7eb1dd70c76a7f1f22a2e93b;hp=c020215e22fd6107d224707da1457c1971ec779f;hpb=d28df0d848dc7e30f2df67518a251b52981a1093;p=wmpus diff --git a/makefile b/makefile index c020215..1e64c67 100644 --- a/makefile +++ b/makefile @@ -1,26 +1,57 @@ -WM ?= wmii -SYS ?= x11 -CFLAGS ?= -g -Wall -Werror - -ifeq ($(SYS),x11) -CC = gcc -LIBS += -lX11 -lXinerama -PROG = wmpus +# wmpus - cross platofrm window manager +# See LICENSE file for copyright and license details. + +-include config.mk + +VERSION ?= 0.1-rc1 +WM ?= wmii +SYS ?= x11 +CFLAGS ?= -g -Wall +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man + +ifeq ($(SYS),xcb) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lxcb -lxcb-keysyms -lxcb-util -lxcb-xinerama +endif + +ifeq ($(SYS),xlib) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lX11 -lXinerama endif ifeq ($(SYS),win32) -CC = i686-pc-mingw32-gcc -CFLAGS += -D_MODE_T_ -DMARGIN=15 -PROG = wmpus.exe +GCC ?= mingw32-gcc +PROG ?= wmpus.exe +LDFLAGS += -lgdi32 endif -include config.mk +all: $(PROG) + +clean: + rm -f wmpus *.exe *.o + +dist: + tar -czf wmpus-$(VERSION).tar.gz --transform s::wmpus-$(VERSION)/: \ + README LICENSE config.mk.example makefile *.1 *.c *.h + +install: all + sed -i 's:/usr.*:$(PREFIX)/bin/wmpus:' wmpus.session + install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG) + install -m 644 -D wmpus.1 $(DESTDIR)$(MANPREFIX)/man1/wmpus.1 + install -m 755 -D wmpus.session $(DESTDIR)/etc/X11/Sessions/wmpus + install -m 644 -D wmpus.desktop $(DESTDIR)$(PREFIX)/share/xsessions/wmpus.desktop + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG) + rm -f $(DESTDIR)$(MANPREFIX)/man1/wmpus.1 $(PROG): main.o conf.o util.o sys-$(SYS).o wm-$(WM).o - $(CC) $(CFLAGS) -o $@ $+ $(LIBS) + $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS) %.o: %.c $(wildcard *.h) makefile - $(CC) --std=gnu99 $(CFLAGS) -c -o $@ $< + $(GCC) $(CFLAGS) --std=gnu99 -c -o $@ $< -clean: - rm -f wmpus *.exe *.o +.PHONY: all clean dist install uninstall