2 # See LICENSE file for copyright and license details.
6 SRC = dmenu.c draw.c lsx.c
12 @echo dmenu build options:
13 @echo "CFLAGS = ${CFLAGS}"
14 @echo "LDFLAGS = ${LDFLAGS}"
19 @${CC} -c $< ${CFLAGS}
21 ${OBJ}: config.mk draw.h
25 @${CC} -o $@ dmenu.o draw.o ${LDFLAGS}
29 @${CC} -o $@ lsx.o ${LDFLAGS}
33 @rm -f dmenu lsx ${OBJ} dmenu-${VERSION}.tar.gz
36 @echo creating dist tarball
37 @mkdir -p dmenu-${VERSION}
38 @cp LICENSE Makefile README config.mk dmenu.1 draw.h dmenu_run lsx.1 ${SRC} dmenu-${VERSION}
39 @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION}
40 @gzip dmenu-${VERSION}.tar
41 @rm -rf dmenu-${VERSION}
44 @echo installing executables to ${DESTDIR}${PREFIX}/bin
45 @mkdir -p ${DESTDIR}${PREFIX}/bin
46 @cp -f dmenu dmenu_run lsx ${DESTDIR}${PREFIX}/bin
47 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu
48 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run
49 @chmod 755 ${DESTDIR}${PREFIX}/bin/lsx
50 @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
51 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
52 @sed "s/VERSION/${VERSION}/g" < dmenu.1 > ${DESTDIR}${MANPREFIX}/man1/dmenu.1
53 @sed "s/VERSION/${VERSION}/g" < lsx.1 > ${DESTDIR}${MANPREFIX}/man1/lsx.1
54 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dmenu.1
55 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/lsx.1
58 @echo removing executables from ${DESTDIR}${PREFIX}/bin
59 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu
60 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_run
61 @rm -f ${DESTDIR}${PREFIX}/bin/lsx
62 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
63 @rm -f ${DESTDIR}${MANPREFIX}/man1/dmenu.1
64 @rm -f ${DESTDIR}${MANPREFIX}/man1/lsx.1
66 .PHONY: all options clean dist install uninstall