Makefile (1305B)
1 # wmname - prints/sets the WM name 2 3 include config.mk 4 5 SRC = wmname.c 6 OBJ = ${SRC:.c=.o} 7 8 all: options wmname 9 10 options: 11 @echo wmname build options: 12 @echo "CFLAGS = ${CFLAGS}" 13 @echo "LDFLAGS = ${LDFLAGS}" 14 @echo "CC = ${CC}" 15 @echo "LD = ${LD}" 16 17 .c.o: 18 @echo CC $< 19 @${CC} -c ${CFLAGS} $< 20 21 ${OBJ}: config.mk 22 23 wmname: ${OBJ} 24 @echo LD $@ 25 @${LD} -o $@ ${OBJ} ${LDFLAGS} 26 @strip $@ 27 28 clean: 29 @echo cleaning 30 @rm -f wmname ${OBJ} wmname-${VERSION}.tar.gz 31 32 dist: clean 33 @echo creating dist tarball 34 @mkdir -p wmname-${VERSION} 35 @cp -R LICENSE Makefile README config.mk wmname.1 ${SRC} wmname-${VERSION} 36 @tar -cf wmname-${VERSION}.tar wmname-${VERSION} 37 @gzip wmname-${VERSION}.tar 38 @rm -rf wmname-${VERSION} 39 40 install: all 41 @echo installing executable file to ${DESTDIR}${PREFIX}/bin 42 @mkdir -p ${DESTDIR}${PREFIX}/bin 43 @cp -f wmname ${DESTDIR}${PREFIX}/bin 44 @chmod 755 ${DESTDIR}${PREFIX}/bin/wmname 45 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 46 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 47 @sed "s/VERSION/${VERSION}/g" < wmname.1 > ${DESTDIR}${MANPREFIX}/man1/wmname.1 48 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/wmname.1 49 50 uninstall: 51 @echo removing executable file from ${DESTDIR}${PREFIX}/bin 52 @rm -f ${DESTDIR}${PREFIX}/bin/wmname 53 54 .PHONY: all options clean dist install uninstall