- 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.html: INSTALL
- $(txt2pre)
-index.html: README
- $(txt2pre)
-
-docs_html := INSTALL.html
+ $(INSTALL) -d -m 755 $(DESTDIR)$(INSTALLMAN1DIR)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
+ $(INSTALL) -m 644 $(man1) $(DESTDIR)$(INSTALLMAN1DIR)
+ $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
+ $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
+ $(INSTALL) -m 644 $(man8) $(DESTDIR)$(man8dir)
+
+doc_install :: install-man
+
+check :: check-man
+check_man = $(AWK) \
+ '{gsub(/\b./,"")}$$0 !~ /\.onion/&&length>80{print;e=1}END{exit(e)}' \
+ >&2
+
+check-man :: $(check_80)
+
+check-lexgrog :: $(check_lexgrog)
+
+all :: $(docs)
+
+txt2pre = $(PERL) -I lib ./Documentation/txt2pre >$@
+
+Documentation/standards.txt : Documentation/standards.perl
+ $(PERL) -w Documentation/standards.perl >$@+
+ touch -r Documentation/standards.perl $@+
+ mv $@+ $@
+
+# flow.txt is checked into git since Graph::Easy isn't in many distros
+Documentation/flow.txt : Documentation/flow.ge
+ (sed -ne '1,/^$$/p' <Documentation/flow.ge; \
+ $(GRAPH_EASY) Documentation/flow.ge || \
+ cat Documentation/flow.txt; \
+ echo; \
+ sed -ne '/^# Copyright/,$$p' <Documentation/flow.ge \
+ ) >$@+
+ touch -r Documentation/flow.ge $@+
+ mv $@+ $@
+
+NEWS NEWS.atom NEWS.html : $(news_deps)
+ $(PERL) -I lib -w Documentation/mknews.perl $@ $(RELEASES)
+
+# check for internal API changes:
+check :: NEWS .NEWS.atom.check NEWS.html
+
+.NEWS.atom.check: NEWS.atom
+ $(XMLSTARLET) val NEWS.atom || \
+ { e=$$?; test $$e -eq 0 || test $$e -eq 127; }
+ >$@
+