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