-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
35 lines (28 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
NAME=domaincheck
VERSION=$(shell sed -n -e 's/^VERSION = "\(.*\)"/\1/p' src/${NAME}.py)
PREFIX?=/usr/local
PIP?=pip3
help:
@echo "The following targets are available:"
@echo "doc format man page into .txt"
@echo "install install ${NAME} into ${PREFIX}"
@echo "pip-install install ${NAME} using ${PIP}"
@echo "readme generate the README after a manual page update"
@echo "uninstall uninstall ${NAME} from ${PREFIX}"
doc: doc/${NAME}.1.txt
doc/${NAME}.1.txt: doc/${NAME}.1
mandoc -c -O width=80 $? | col -b >$@
readme: doc
sed -n -e '/^NAME/!p;//q' README.md >.readme
sed -n -e '/^NAME/,$$p' -e '/authors/q' doc/${NAME}.1.txt >>.readme
echo '```' >>.readme
mv .readme README.md
pip-install:
${PIP} install .
rm -fr build src/${NAME}.egg-info
install:
mkdir -p ${PREFIX}/bin ${PREFIX}/share/man/man1
install -c -m 0555 src/${NAME}.py ${PREFIX}/bin/${NAME}
install -c -m 0555 doc/${NAME}.1 ${PREFIX}/share/man/man1/${NAME}.1
uninstall:
rm -f ${PREFIX}/bin/${NAME} ${PREFIX}/share/man/man1/${NAME}.1