-mandefs = $(top_builddir)/defs.man
-
-mansubst = sed \
- -e '/@@@PRE@@@/ {' \
- -e 'r$(mandefs)' \
- -e 'd' \
- -e '}'
-
-.1.in.1 .5.in.5 .7.in.7 .8.in.8: $(mandefs)
- $(mansubst) $< >$@.new && mv $@.new $@
-
-$(mandefs): $(top_srcdir)/defs.man.in Makefile
- $(confsubst) $(top_srcdir)/defs.man.in >$@.new $(SUBSTITUTIONS)
- sed '/^\.$$/ d; /^\.\\"/ d' $@.new >$@.new2
- rm -f $@.new
- mv $@.new2 $@
+mandefs = $(top_srcdir)/common/defs.man
+makesummary = $(top_srcdir)/common/make-summary
+
+V_MAN = $(V_MAN_$(V))
+V_MAN_ = $(V_MAN_$(AM_DEFAULT_VERBOSITY))
+V_MAN_0 = @echo " MAN $@";
+
+.1.in.1 .5.in.5 .7.in.7 .8.in.8:
+ $(V_MAN)
+ $(AM_V_at)sed '/^\.$$/ d; /^\.\\"/ d' $(mandefs) >$@.defs
+ $(AM_V_at)sed -e '/@@@PRE@@@/ {' -e 'r$@.defs' -e 'd' -e '}' \
+ $< >$@.merge
+ $(AM_V_at)$(confsubst) $@.merge >$@.subst $(SUBSTITUTIONS)
+ $(AM_V_at)awk -f $(makesummary) $@.subst >$@.new
+ $(AM_V_at)rm -f $@.defs $@.merge $@.subst && mv $@.new $@