X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;ds=sidebyside;f=makefile;h=20162c4c2328511596b3f3ab363aab412ed07b26;hb=15b46c3f2fe15422ca4023edcbb15b09ea46a49a;hp=651cf2cf1f3dba8c4a89e028b397bd7541c20afd;hpb=eefa2034ad0f5c2ef5eb478984cfc53a6a40c6b7;p=wmpus diff --git a/makefile b/makefile index 651cf2c..20162c4 100644 --- a/makefile +++ b/makefile @@ -1,24 +1,48 @@ -WM ?= wmii -SYS ?= x11 -CFLAGS ?= -g -Wall -Werror +# wmpus - cross platofrm window manager +# See LICENSE file for copyright and license details. + +-include config.mk + +VERSION ?= 0.1-p0 +WM ?= wmii +SYS ?= x11 +CFLAGS ?= -g -Wall +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man ifeq ($(SYS),x11) -CC = gcc -LIBS += -lX11 -lXinerama -PROG = wmpus +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lX11 -lXinerama endif ifeq ($(SYS),win32) -CC = i686-pc-mingw32-gcc -CFLAGS += -D_NO_OLDNAMES -DMARGIN=15 -PROG = wmpus.exe +GCC ?= i486-mingw32-gcc +PROG ?= wmpus.exe +LDFLAGS += -lgdi32 endif -$(PROG): main.o util.o sys-$(SYS).o wm-$(WM).o - $(CC) $(CFLAGS) -o $@ $+ $(LIBS) - -%.o: %.c $(wildcard *.h) makefile - $(CC) --std=gnu99 $(CFLAGS) -c -o $@ $< +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 + install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG) + install -m 644 -D wmpus.1 $(DESTDIR)$(MANPREFIX)/man1/wmpus.1 + +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