annotate Makefile @ 16:cb5813c117e2

merge heads
author paulo
date Mon, 09 Apr 2018 20:13:53 -0600
parents
children
rev   line source
paulo@0 1 # dwm - dynamic window manager
paulo@0 2 # (C)opyright MMVI-MMVII Anselm R. Garbe
paulo@0 3
paulo@0 4 include config.mk
paulo@0 5
paulo@0 6 SRC = client.c draw.c event.c layout.c main.c tag.c util.c
paulo@0 7 OBJ = ${SRC:.c=.o}
paulo@0 8
paulo@0 9 all: options dwm
paulo@0 10
paulo@0 11 options:
paulo@0 12 @echo dwm build options:
paulo@0 13 @echo "CFLAGS = ${CFLAGS}"
paulo@0 14 @echo "LDFLAGS = ${LDFLAGS}"
paulo@0 15 @echo "CC = ${CC}"
paulo@0 16
paulo@0 17 .c.o:
paulo@0 18 @echo CC $<
paulo@0 19 @${CC} -c ${CFLAGS} $<
paulo@0 20
paulo@0 21 ${OBJ}: dwm.h config.h config.mk
paulo@0 22
paulo@0 23 config.h:
paulo@0 24 @echo creating $@ from config.default.h
paulo@0 25 @cp config.default.h $@
paulo@0 26
paulo@0 27 dwm: ${OBJ}
paulo@0 28 @echo CC -o $@
paulo@0 29 @${CC} -o $@ ${OBJ} ${LDFLAGS}
paulo@0 30 @strip $@
paulo@0 31
paulo@0 32 clean:
paulo@0 33 @echo cleaning
paulo@0 34 @rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
paulo@0 35
paulo@0 36 dist: clean
paulo@0 37 @echo creating dist tarball
paulo@0 38 @mkdir -p dwm-${VERSION}
paulo@0 39 @cp -R LICENSE Makefile README config.*.h config.mk \
paulo@0 40 dwm.1 dwm.h ${SRC} dwm-${VERSION}
paulo@0 41 @tar -cf dwm-${VERSION}.tar dwm-${VERSION}
paulo@0 42 @gzip dwm-${VERSION}.tar
paulo@0 43 @rm -rf dwm-${VERSION}
paulo@0 44
paulo@0 45 install: all
paulo@0 46 @echo installing executable file to ${DESTDIR}${PREFIX}/bin
paulo@0 47 @mkdir -p ${DESTDIR}${PREFIX}/bin
paulo@0 48 @cp -f dwm ${DESTDIR}${PREFIX}/bin
paulo@0 49 @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
paulo@0 50 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
paulo@0 51 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
paulo@0 52 @sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
paulo@0 53 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
paulo@0 54
paulo@0 55 uninstall:
paulo@0 56 @echo removing executable file from ${DESTDIR}${PREFIX}/bin
paulo@0 57 @rm -f ${DESTDIR}${PREFIX}/bin/dwm
paulo@0 58 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
paulo@0 59 @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
paulo@0 60
paulo@0 61 .PHONY: all options clean dist install uninstall