util.c: output function might override errno and thus affect perror()
[dwm.git] / Makefile
blobffa69b409fd31374cba5645b82f88e91179b1b8d
1 # dwm - dynamic window manager
2 # See LICENSE file for copyright and license details.
4 include config.mk
6 SRC = drw.c dwm.c util.c
7 OBJ = ${SRC:.c=.o}
9 all: dwm
11 .c.o:
12 ${CC} -c ${CFLAGS} $<
14 ${OBJ}: config.h config.mk
16 config.h:
17 cp config.def.h $@
19 dwm: ${OBJ}
20 ${CC} -o $@ ${OBJ} ${LDFLAGS}
22 clean:
23 rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
25 dist: clean
26 mkdir -p dwm-${VERSION}
27 cp -R LICENSE Makefile README config.def.h config.mk\
28 dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
29 tar -cf dwm-${VERSION}.tar dwm-${VERSION}
30 gzip dwm-${VERSION}.tar
31 rm -rf dwm-${VERSION}
33 install: all
34 mkdir -p ${DESTDIR}${PREFIX}/bin
35 cp -f dwm ${DESTDIR}${PREFIX}/bin
36 chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
37 mkdir -p ${DESTDIR}${MANPREFIX}/man1
38 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
39 chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
41 uninstall:
42 rm -f ${DESTDIR}${PREFIX}/bin/dwm\
43 ${DESTDIR}${MANPREFIX}/man1/dwm.1
45 .PHONY: all clean dist install uninstall