- test -z "$(man1)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
- test -z "$(man5)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
- test -z "$(man7)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
- test -z "$(man1)" || $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
- test -z "$(man5)" || $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
- test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
-%.1 %.5 %.7 : Documentation/%.txt
- $(pandoc) -s -t man < $< > $@+ && mv $@+ $@
-
-txt2pre = ./Documentation/txt2pre < $< > $@+ && touch -r $< $@+ && mv $@+ $@
-txt = INSTALL README COPYING
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
+ $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
+ $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
+ $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
+ $(INSTALL) -m 644 $(man8) $(DESTDIR)$(man8dir)
+
+doc_install :: install-man
+
+%.1 %.5 %.7 %.8 : Documentation/%.pod
+ $(podman) -s $(subst .,,$(suffix $@)) $< $@+ && mv $@+ $@
+
+check :: check-man
+check_man = @echo CHECK80 $<;COLUMNS=80 $(MAN) ./$^ | \
+ $(AWK) '{gsub(/\b./,"")}length>80{print;err=1}END{exit(err)}' >&2
+
+%.1.cols : %.1; $(check_man)
+%.5.cols : %.5; $(check_man)
+%.7.cols : %.7; $(check_man)
+%.8.cols : %.8; $(check_man)
+
+check-man :: $(addsuffix .cols, $(manpages))
+
+manuals :=
+manuals += $(m1)
+manuals += $(m5)
+manuals += $(m7)
+manuals += $(m8)
+
+mantxt = $(addprefix Documentation/, $(addsuffix .txt, $(manuals)))
+docs += $(mantxt)
+dtxt += $(mantxt)
+docs += NEWS
+
+all :: $(docs)
+
+Documentation/%.txt : Documentation/%.pod
+ $(podtext) $< $@+ && touch -r $< $@+ && mv $@+ $@
+
+txt2pre = $(PERL) -I lib ./Documentation/txt2pre <$< >$@+ && \
+ touch -r $< $@+ && mv $@+ $@
+
+Documentation/standards.txt : Documentation/standards.perl
+ $(PERL) $< >$@+ && touch -r $< $@+ && mv $@+ $@
+
+RELEASES =
+RELEASES += v1.2.0
+RELEASES += v1.1.0-pre1
+RELEASES += v1.0.0
+
+NEWS NEWS.atom NEWS.html : Documentation/include.mk
+ $(PERL) -I lib -w Documentation/mknews.perl $@ $(RELEASES)
+
+# check for internal API changes:
+check :: NEWS check-NEWS.atom NEWS.html
+
+check-NEWS.atom: NEWS.atom
+ $(XMLSTARLET) val NEWS.atom || \
+ { e=$$?; test $$e -eq 0 || test $$e -eq 127; }
+
+Documentation/%.html: Documentation/%.txt
+ $(txt2pre)