X-Git-Url: http://pileus.org/git/?p=wmpus;a=blobdiff_plain;f=makefile;h=caceac9e8de918f6ef00c6b0088efea6ea209d8f;hp=a3f9952d5e11cf88f1e9e19626a0e69d20f89fd3;hb=refs%2Fheads%2Fmaster;hpb=1d8f2e6933d91390670b30d86e4492a54354e2ac diff --git a/makefile b/makefile index a3f9952..caceac9 100644 --- a/makefile +++ b/makefile @@ -1,32 +1,51 @@ -WM=wmii - -SYS=x11 -CC=gcc -PROG=awm -CFLAGS=-g -Werror -Wall -LIBS=-Wl,--as-needed -lX11 -TEST=DISPLAY=:2.0 - -ifdef WIN32 -SYS=win32 -CC=i686-pc-mingw32-gcc -CFLAGS=-g -Werror -Wall -LIBS= -PROG=awm.exe -TEST=wine -endif +# wmpus - cross platofrm window manager +# See LICENSE file for copyright and license details. -test: $(PROG) - $(TEST) ./$< +-include config.mk -debug: $(PROG) - $(TEST) gdb ./$< +VERSION ?= 0.1-rc1 +WM ?= wmii +SYS ?= x11 +CFLAGS ?= -g -Wall +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man -$(PROG): main.o util.o sys-$(SYS).o wm-$(WM).o - $(CC) $(CFLAGS) -o $@ $+ $(LIBS) +ifeq ($(SYS),x11) +GCC ?= gcc +PROG ?= wmpus +LDFLAGS += -lX11 -lXinerama +endif -%.o: %.c $(wildcard *.h) - $(CC) --std=gnu99 $(CFLAGS) -c -o $@ $< +ifeq ($(SYS),win32) +GCC ?= i486-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