Makefile: Don't leave $(GROFF_LOG) files behind

Convert "GROFF_LOG" into a shell variable local to the
recipe for "check-groff-warnings" target such that the
temporary file is only created when needed.

Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Alexander Miller <alex.miller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alexander Miller 2016-04-14 01:13:04 +02:00 committed by Michael Kerrisk
parent e1124af0ba
commit 23509e5201
1 changed files with 4 additions and 4 deletions

View File

@ -63,14 +63,14 @@ install:
# Check if groff reports warnings (may be words of sentences not displayed)
# from http://lintian.debian.org/tags/manpage-has-errors-from-man.html
GROFF_LOG := $(shell mktemp /tmp/manpages-checksXXXX)
check-groff-warnings:
GROFF_LOG=$$(mktemp /tmp/manpages-checksXXXX); \
for i in man?/*.[1-9]; \
do \
if grep -q 'SH.*NAME' $$i; then \
LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$(GROFF_LOG); \
[ -s $(GROFF_LOG) ] && ( echo "$$i: " ; cat $(GROFF_LOG) ; echo "" ); \
rm $(GROFF_LOG) 2>/dev/null; \
LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$$GROFF_LOG; \
[ -s $$GROFF_LOG ] && ( echo "$$i: " ; cat $$GROFF_LOG ; echo "" ); \
rm $$GROFF_LOG 2>/dev/null; \
fi \
done