JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
8e4818556b58f80099f2f7b0fcf14f6c8e082818
[dwm.git] / Makefile
1 # dwm - dynamic window manager
2 # © 2006-2007 Anselm R. Garbe, Sander van Dijk
3
4 include config.mk
5
6 SRC += bar.c client.c event.c main.c screen.c util.c
7 OBJ = ${SRC:.c=.o}
8
9 all: options dwm
10
11 options:
12         @echo dwm build options:
13         @echo "CFLAGS   = ${CFLAGS}"
14         @echo "LDFLAGS  = ${LDFLAGS}"
15         @echo "CC       = ${CC}"
16
17 .c.o:
18         @echo CC $<
19         @${CC} -c ${CFLAGS} $<
20
21 ${OBJ}: dwm.h config.h config.mk
22
23 dwm: ${OBJ}
24         @echo CC -o $@
25         @${CC} -o $@ ${OBJ} ${LDFLAGS}
26
27 clean:
28         @echo cleaning
29         @rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
30
31 dist: clean
32         @echo creating dist tarball
33         @mkdir -p dwm-${VERSION}
34         @cp -R LICENSE Makefile README config.h config.mk \
35                 dwm.1 dwm.h tile.h ${SRC} dwm-${VERSION}
36         @tar -cf dwm-${VERSION}.tar dwm-${VERSION}
37         @gzip dwm-${VERSION}.tar
38         @rm -rf dwm-${VERSION}
39
40 install: all
41         @echo installing executable file to ${DESTDIR}${PREFIX}/bin
42         @mkdir -p ${DESTDIR}${PREFIX}/bin
43         @cp -f dwm ${DESTDIR}${PREFIX}/bin
44         @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
45         @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
46         @mkdir -p ${DESTDIR}${MANPREFIX}/man1
47         @sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
48         @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
49
50 uninstall:
51         @echo removing executable file from ${DESTDIR}${PREFIX}/bin
52         @rm -f ${DESTDIR}${PREFIX}/bin/dwm
53         @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
54         @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
55
56 .PHONY: all options clean dist install uninstall