summaryrefslogtreecommitdiff
path: root/Makefile
blob: 5d0d24bf5926cd37181605cfb2c4948ad0758e2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
VERSION=20100701-2
DIST=mcwm-$(VERSION)
DISTFILES=LICENSE Makefile NEWS README TODO WISHLIST config.h mcwm.c \
	list.c list.h events.h mcwm.man

CC=gcc
CFLAGS=-g -std=c99 -Wall -Wextra -I/usr/local/include #-DDEBUG
LDFLAGS=-L/usr/local/lib -lxcb -lxcb-keysyms -lxcb-icccm -lxcb-atom

RM=/bin/rm
PREFIX=/usr/local

TARGETS=mcwm
OBJS=mcwm.o list.o

all: $(TARGETS)

mcwm: $(OBJS) config.h events.h Makefile
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)

mcwm-static: mcwm.c config.h events.h Makefile
	$(CC) -o $@ $(OBJS) -static -g -std=c99 -Wextra -Wall \
	-I/usr/local/include/ -L/usr/local/lib \
	-lxcb -lxcb-keysyms -lxcb-icccm -lxcb-atom  -lxcb-property \
	-lxcb-event -lXau -lXdmcp

install: $(TARGETS)
	install -m 755 mcwm $(PREFIX)/bin

deinstall:
	$(RM) $(PREFIX)/bin/mcwm

$(DIST).tar.bz2:
	mkdir $(DIST)
	cp $(DISTFILES) $(DIST)/
	tar cf $(DIST).tar --exclude .git $(DIST)
	bzip2 -9 $(DIST).tar
	$(RM) -rf $(DIST)

dist: $(DIST).tar.bz2

clean:
	$(RM) -f $(TARGETS) *.o

distclean: clean
	$(RM) -f $(DIST).tar.bz2