Blob


1 # lsblk - list block devices
2 # See LICENSE file for copyright and license details.
3 .POSIX:
5 VERSION = 1.2
6 PREFIX = /usr/local
7 MANPREFIX = ${PREFIX}/man
8 MY_CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -DVERSION=\"${VERSION}\" ${CFLAGS}
9 LIBS = -lutil
11 all: lsblk
13 lsblk: lsblk.c
14 ${CC} -o lsblk lsblk.c ${MY_CFLAGS} ${LIBS}
16 clean:
17 rm -f lsblk
19 install: lsblk
20 mkdir -p ${DESTDIR}${PREFIX}/sbin ${DESTDIR}${MANPREFIX}/man8
21 cp -f lsblk ${DESTDIR}${PREFIX}/sbin
22 chmod 755 ${DESTDIR}${PREFIX}/sbin/lsblk
23 sed "s/@VERSION@/${VERSION}/" lsblk.8 > ${DESTDIR}${MANPREFIX}/man8/lsblk.8
25 unroot:
26 chgrp operator ${DESTDIR}${PREFIX}/sbin/lsblk
27 chmod g+s ${DESTDIR}${PREFIX}/sbin/lsblk
29 uninstall:
30 rm -f ${DESTDIR}${PREFIX}/sbin/lsblk ${DESTDIR}${MANPREFIX}/man8/lsblk.8