Commit 9c45babb authored by Iustin Pop's avatar Iustin Pop

Makefile: improve the fix for .DELETE_ON_ERROR

I've investigated more and it seems that .DELETE_ON_ERROR not working
is a bug/regression in some versions of make; testing with make 3.82
from Debian experimental makes this special target work as
expected. Also, make 3.81 works on trivial Makefiles, but not on our
complex one.

In the meantime, let's improve the fix for the building of man pages:
make the removal implicit, instead of explicit, via the use of 'trap'
on EXIT. I just hope this behaves consistently across all bash
versions :)
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 4892d955
......@@ -919,10 +919,12 @@ man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
set -o pipefail ; \
trap 'echo auto-removing $@; rm $@' EXIT; \
$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
sed -e 's/\\@/@/g' > $@
if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@ || \
{ rm -f "$@"; exit 1; } ; fi
sed -e 's/\\@/@/g' > $@; \
if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi; \
trap - EXIT
man/%.html.in: man/%.gen man/footer.html
@test -n "$(PANDOC)" || \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment