X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=makefile;h=e854d818bf8a6bb7a11ed6febbafa2c19ff967f6;hb=bafa6f74e4a8112b650cb1aa2894bc5c0184fca5;hp=b1c9092e15da8bf3c703f34774e2af13f13fc71c;hpb=58936d6ab733acf784cf8b1a8f6839b7a75bfe7a;p=wmpus diff --git a/makefile b/makefile index b1c9092..e854d81 100644 --- a/makefile +++ b/makefile @@ -1,24 +1,48 @@ -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-p0 +WM ?= wmii +SYS ?= x11 +CFLAGS ?= -g -Wall +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man -test: $(PROG) - DISPLAY=:2.0 ./$< +ifeq ($(SYS),x11) +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 ?= i686-pc-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 + 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