X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=makefile;h=400ce7a50c8dc4fe309edca2aadfab2e7d77fb38;hb=84fdb5249282e858b32f59f49a877a07350a48eb;hp=b1c9092e15da8bf3c703f34774e2af13f13fc71c;hpb=58936d6ab733acf784cf8b1a8f6839b7a75bfe7a;p=wmpus diff --git a/makefile b/makefile index b1c9092..400ce7a 100644 --- a/makefile +++ b/makefile @@ -1,24 +1,57 @@ -WM=wmii +# wmpus - cross platofrm window manager +# See LICENSE file for copyright and license details. -SYS=x11 -CC=gcc -PROG=awm -CFLAGS=-g -Wall -LIBS=-Wl,--as-needed -lX11 +-include config.mk -#SYS=win32 -#CC=i686-pc-mingw32-gcc -#CFLAGS=-g -Wall -mwindows -#PROG=awm.exe +VERSION ?= 0.1-rc1 +WM ?= wmii +SYS ?= x11 +CFLAGS ?= -g -Wall +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man -test: $(PROG) - DISPLAY=:2.0 ./$< +ifeq ($(SYS),xcb) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lxcb -lxcb-keysyms -lxcb-util -lxcb-ewmh -lxcb-xinerama +endif -$(PROG): main.o util.o sys-$(SYS).o wm-$(WM).o - $(CC) $(CFLAGS) -o $@ $+ $(LIBS) +ifeq ($(SYS),xlib) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lX11 -lXinerama +endif -%.o: %.c $(wildcard *.h) - $(CC) --std=gnu99 $(CFLAGS) -c -o $@ $< +ifeq ($(SYS),win32) +GCC ?= mingw32-gcc +PROG ?= wmpus.exe +LDFLAGS += -lgdi32 +endif + +all: $(PROG) clean: - rm -f $(PROG) *.o + 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 + $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS) + +%.o: %.c $(wildcard *.h) makefile + $(GCC) $(CFLAGS) --std=gnu99 -c -o $@ $< + +.PHONY: all clean dist install uninstall