diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0cfd20d --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | # dmenu - dynamic menu | ||
| 2 | # (C)opyright MMVI Anselm R. Garbe | ||
| 3 | |||
| 4 | include config.mk | ||
| 5 | |||
| 6 | SRC = draw.c main.c util.c | ||
| 7 | OBJ = ${SRC:.c=.o} | ||
| 8 | |||
| 9 | all: options dmenu | ||
| 10 | @echo finished | ||
| 11 | |||
| 12 | options: | ||
| 13 | @echo dmenu build options: | ||
| 14 | @echo "CFLAGS = ${CFLAGS}" | ||
| 15 | @echo "LDFLAGS = ${LDFLAGS}" | ||
| 16 | @echo "CC = ${CC}" | ||
| 17 | |||
| 18 | .c.o: | ||
| 19 | @echo CC $< | ||
| 20 | @${CC} -c ${CFLAGS} $< | ||
| 21 | |||
| 22 | ${OBJ}: dmenu.h config.h | ||
| 23 | |||
| 24 | config.h: | ||
| 25 | @echo creating $@ from config.default.h | ||
| 26 | @cp config.default.h $@ | ||
| 27 | |||
| 28 | dmenu: ${OBJ} | ||
| 29 | @echo LD $@ | ||
| 30 | @${CC} -o $@ ${OBJ} ${LDFLAGS} | ||
| 31 | |||
| 32 | clean: | ||
| 33 | @echo cleaning | ||
| 34 | @rm -f dmenu ${OBJ} dmenu-${VERSION}.tar.gz | ||
| 35 | |||
| 36 | dist: clean | ||
| 37 | @echo creating dist tarball | ||
| 38 | @mkdir -p dmenu-${VERSION} | ||
| 39 | @cp -R LICENSE Makefile README config.mk \ | ||
| 40 | dmenu.1 dmenu.h ${SRC} dmenu-${VERSION} | ||
| 41 | @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION} | ||
| 42 | @gzip dmenu-${VERSION}.tar | ||
| 43 | @rm -rf dmenu-${VERSION} | ||
| 44 | |||
| 45 | install: all | ||
| 46 | @echo installing executable file to ${DESTDIR}${PREFIX}/bin | ||
| 47 | @mkdir -p ${DESTDIR}${PREFIX}/bin | ||
| 48 | @cp -f dmenu ${DESTDIR}${PREFIX}/bin | ||
| 49 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu | ||
| 50 | @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 | ||
| 51 | @mkdir -p ${DESTDIR}${MANPREFIX}/man1 | ||
| 52 | @cp -f dmenu.1 ${DESTDIR}${MANPREFIX}/man1 | ||
| 53 | @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dmenu.1 | ||
| 54 | |||
| 55 | uninstall: | ||
| 56 | @echo removing executable file from ${DESTDIR}${PREFIX}/bin | ||
| 57 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu | ||
| 58 | @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 | ||
| 59 | @rm -f ${DESTDIR}${MANPREFIX}/man1/dmenu.1 | ||
| 60 | |||
| 61 | .PHONY: all options clean dist install uninstall | ||
