Makefile (1036B)
1.POSIX: 2 3NAME = smu 4VERSION = 1.5 5 6# paths 7PREFIX = /usr/local 8MANPREFIX = ${PREFIX}/share/man 9 10# flags 11SMU_CFLAGS = -DVERSION=\"${VERSION}\" ${CFLAGS} 12SMU_LDFLAGS = ${LDFLAGS} 13 14SRC = ${NAME}.c 15OBJ = ${SRC:.c=.o} 16BIN = ${NAME} 17MAN1 = ${NAME}.1 18 19all: ${BIN} 20 21.c.o: 22 ${CC} -c ${SMU_CFLAGS} $< 23 24${OBJ}: 25 26${BIN}: ${OBJ} 27 ${CC} -o $@ ${OBJ} ${SMU_LDFLAGS} 28 29clean: 30 rm -f ${BIN} ${OBJ} "${NAME}-${VERSION}.tar.gz" 31 32dist: clean 33 mkdir -p "${NAME}-${VERSION}" 34 cp -R LICENSE README testdoc Makefile ${MAN1} ${SRC} "${NAME}-${VERSION}" 35 tar -cf - "${NAME}-${VERSION}" | \ 36 gzip -c > "${NAME}-${VERSION}.tar.gz" 37 rm -rf "${NAME}-${VERSION}" 38 39install: all 40 mkdir -p "${DESTDIR}${PREFIX}/bin" 41 cp -f ${BIN} "${DESTDIR}${PREFIX}/bin" 42 chmod 755 "${DESTDIR}${PREFIX}/bin/${BIN}" 43 mkdir -p "${DESTDIR}${MANPREFIX}/man1" 44 cp -f ${MAN1} "${DESTDIR}${MANPREFIX}/man1" 45 chmod 644 "${DESTDIR}${MANPREFIX}/man1/${MAN1}" 46 47uninstall: 48 rm -f "${DESTDIR}${PREFIX}/bin/${BIN}" \ 49 "${DESTDIR}${MANPREFIX}/man1/${MAN1}" 50 51.PHONY: all clean dist install uninstall