2 # See LICENSE file for copyright and license details.
6 all: options dmenu dmenu_path
9 @echo dmenu build options:
10 @echo "CFLAGS = ${CFLAGS}"
11 @echo "LDFLAGS = ${LDFLAGS}"
16 @${CC} -o $@ dmenu.o draw.o ${LDFLAGS}
20 @${CC} -c $< ${CFLAGS}
24 @${CC} -o $@ $< ${LDFLAGS}
28 @rm -f dmenu dmenu.o draw.o dmenu_path dmenu_path.o dmenu-${VERSION}.tar.gz
31 @echo creating dist tarball
32 @mkdir -p dmenu-${VERSION}
33 @cp LICENSE Makefile README config.mk dmenu.1 dmenu.c draw.c draw.h dmenu_path.c dmenu_run dmenu-${VERSION}
34 @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION}
35 @gzip dmenu-${VERSION}.tar
36 @rm -rf dmenu-${VERSION}
39 @echo installing executables to ${DESTDIR}${PREFIX}/bin
40 @mkdir -p ${DESTDIR}${PREFIX}/bin
41 @cp -f dmenu dmenu_path dmenu_run ${DESTDIR}${PREFIX}/bin
42 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu
43 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_path
44 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run
45 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
46 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
47 @sed "s/VERSION/${VERSION}/g" < dmenu.1 > ${DESTDIR}${MANPREFIX}/man1/dmenu.1
48 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dmenu.1
51 @echo removing executables from ${DESTDIR}${PREFIX}/bin
52 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu
53 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_path
54 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_run
55 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
56 @rm -f ${DESTDIR}${MANPREFIX}/man1/dmenu.1
58 .PHONY: all options clean dist install uninstall