-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
35 lines (26 loc) · 920 Bytes
/
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=spf
PREFIX?=/usr/local
PERL!=which perl
help:
@echo "The following targets are available:"
@echo "clean remove temporary files"
@echo "install install ${NAME} under ${PREFIX}"
@echo "prep update the perl path in the source script"
@echo "readme generate the README after a manual page update"
prep: src/${NAME}
src/${NAME}: src/${NAME}.pl
sed -e "s|/usr/local/bin/perl|${PERL}|" $? >$@
install: prep
mkdir -p ${PREFIX}/bin ${PREFIX}/share/man/man1
install -c -m 555 src/${NAME} ${PREFIX}/bin/${NAME}
install -c -m 444 doc/${NAME}.1 ${PREFIX}/share/man/man1/${NAME}.1
clean:
rm -f src/${NAME} doc/${NAME}.1.txt
man: doc/${NAME}.1.txt
doc/${NAME}.1.txt: doc/${NAME}.1
mandoc -T ascii -c -O width=80 $? | col -b >$@
readme: man
sed -n -e '/^NAME/!p;//q' README.md >.readme
sed -n -e '/^NAME/,$$p' -e '/emailing/q' doc/${NAME}.1.txt >>.readme
echo '```' >>.readme
mv .readme README.md