-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (70 loc) · 1.78 KB
/
Makefile
File metadata and controls
86 lines (70 loc) · 1.78 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# $OpenBSD$
MAN= sysclean.8
SCRIPT= sysclean.pl
BINDIR?= /usr/local/sbin
MANDIR?= /usr/local/man/man
realinstall:
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/${SCRIPT} ${DESTDIR}${BINDIR}/sysclean
README.md: sysclean.8
mandoc -T markdown sysclean.8 \
| sed -e 's/ / /g' \
-e 's/</</g' \
-e 's/>/>/g' \
-e 's/\\\[/[/g' \
>$@
regress: run-regress-perl-syntax \
run-regress-man-lint \
run-regress-man-readme \
run-regress-man-date
# check perl syntax
run-regress-perl-syntax:
@echo TEST: perl syntax
@perl -c sysclean.pl
# check man page
run-regress-man-lint:
@echo TEST: man page lint
@mandoc -T lint -W style sysclean.8
# ensure README.md and man page are in sync
run-regress-man-readme:
@echo TEST: README.md sync
@mv README.md README.md.orig
@${MAKE} README.md
@mv README.md README.md.new
@mv README.md.orig README.md
diff -q README.md README.md.new
@rm README.md.new
# ensure .Dd date inside man page is the right date
run-regress-man-date:
@echo TEST: man page date
@if [ -d .git ]; then \
grep -qF -- \
"$$(date -r $$(git log -1 --format=%ct sysclean.8) \
+'.Dd %B %d, %Y')" \
sysclean.8 ; \
elif [ -d .got ]; then \
grep -qF -- \
"$$(got log -l 1 sysclean.8 \
| sed -ne 's/^date: //p' \
| xargs -0 date -j -f '%a %b %d %T %Y %Z' \
+'.Dd %B %d, %Y')" \
sysclean.8 ; \
else \
echo "unchecked" ; \
fi
.if !defined(VERSION)
release:
@echo "error: please define VERSION"; false
.else
release: sysclean-${VERSION}.tar.gz
DISTRIBUTED_FILES = \
Makefile \
README.md \
sysclean.ignore \
${MAN} \
${SCRIPT}
sysclean-${VERSION}.tar.gz: ${DISTRIBUTED_FILES}
chmod a+rX ${DISTRIBUTED_FILES}
pax -w -zf "$@" -s ',^,sysclean-${VERSION}/,' ${DISTRIBUTED_FILES}
.endif
.include <bsd.prog.mk>