# lsblk - list block devices # See LICENSE file for copyright and license details. .POSIX: VERSION = 1.2 PREFIX = /usr/local MANPREFIX = ${PREFIX}/man MY_CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -DVERSION=\"${VERSION}\" ${CFLAGS} LIBS = -lutil all: lsblk lsblk: lsblk.c ${CC} -o lsblk lsblk.c ${MY_CFLAGS} ${LIBS} clean: rm -f lsblk install: lsblk mkdir -p ${DESTDIR}${PREFIX}/sbin ${DESTDIR}${MANPREFIX}/man8 cp -f lsblk ${DESTDIR}${PREFIX}/sbin chmod 755 ${DESTDIR}${PREFIX}/sbin/lsblk sed "s/@VERSION@/${VERSION}/" lsblk.8 > ${DESTDIR}${MANPREFIX}/man8/lsblk.8 unroot: chgrp operator ${DESTDIR}${PREFIX}/sbin/lsblk chmod g+s ${DESTDIR}${PREFIX}/sbin/lsblk uninstall: rm -f ${DESTDIR}${PREFIX}/sbin/lsblk ${DESTDIR}${MANPREFIX}/man8/lsblk.8