X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=makefile;h=a00980e7d19e792fd2d7f0079b358ea354f85322;hb=cc3161fd3b1e9587ff6184f2d69d2c877772266b;hp=d629e6ed4f3f8185324d4cad5aa1fe2a13d8d493;hpb=caa90c89a09fe03c144922d44e3137e4c1fe5d8e;p=wmpus diff --git a/makefile b/makefile index d629e6e..a00980e 100644 --- a/makefile +++ b/makefile @@ -1,33 +1,57 @@ -WM=wmii - -SYS=x11 -CC=gcc -PROG=awm -CFLAGS=-g -Werror -Wall -LIBS=-Wl,--as-needed -lX11 -lXinerama -TEST=DISPLAY=:2.0 - -WIN32= -ifdef WIN32 -SYS=win32 -CC=i686-pc-mingw32-gcc -CFLAGS=-g -Werror -Wall -D_NO_OLDNAMES -LIBS= -PROG=awm.exe -TEST=cp -t /t/htdocs/temp -endif +# 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 -test: $(PROG) - $(TEST) ./$< +ifeq ($(SYS),xcb) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lxcb -lxcb-keysyms -lxcb-util -lxcb-icccm -lxcb-ewmh -lxcb-xinerama +endif -debug: $(PROG) - $(TEST) gdb ./$< +ifeq ($(SYS),xlib) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lX11 -lXinerama +endif -$(PROG): main.o util.o sys-$(SYS).o wm-$(WM).o - $(CC) $(CFLAGS) -o $@ $+ $(LIBS) +ifeq ($(SYS),win32) +GCC ?= mingw32-gcc +PROG ?= wmpus.exe +LDFLAGS += -lgdi32 +endif -%.o: %.c $(wildcard *.h) - $(CC) --std=gnu99 $(CFLAGS) -c -o $@ $< +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