diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-09-17 10:20:44 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-09-17 14:06:14 +0200 |
commit | 168cc7aa947ed992c17d2f6e4db353518338b4a1 (patch) | |
tree | 8c3e87f8bd19f5289c93c56ab5fdb21df6cee306 | |
parent | 093be6d640d01d7cd24a2d87f6901aa3b3cf4fc6 (diff) | |
download | postgresql-setup-168cc7aa947ed992c17d2f6e4db353518338b4a1.tar.gz postgresql-setup-168cc7aa947ed992c17d2f6e4db353518338b4a1.tar.xz postgresql-setup-168cc7aa947ed992c17d2f6e4db353518338b4a1.zip |
man: generate manual page more carefully
In general, we do not want to distribute help2man binary (to avoid
license confusions, etc.). So if the manual needs to be
re-generated, try to use help2man on system or keep warning about
its non-existence.
-rw-r--r-- | doc/Makefile.am | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index d1ed4e5..63d09de 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,10 +1,29 @@ HELP2MAN = $(SHELL) $(top_srcdir)/$(config_aux_dir)/missing --run help2man -man_MANS = $(srcdir)/postgresql$(DISTSUFF)-setup.1 +# The help2man call +# ================= +# Make the rules always dependant on source (thus on postgresql-setup.in, not on +# postgresql-setup), at least for distributed files. Otherwise, the '*.1' +# manual page is regenerated even when distributed and no code change actually +# happened. In case there exists some target generating other file directly +# depending on the generated manual page, we would need 'touch $@'. But it +# seems better to keep warning user about non-existing help2man when '.in' +# changed. +# TODO: make it non-fatal for cross-compilation case also +# TODO: separate it to its own m4 module (for easier distribution) -# TODO: distribute also help2man +HELP2MAN_RUN = \ + file=$< ; \ + file=$${file%%.in} ; \ + $(HELP2MAN) --output=$@ $$file -N ; \ + rs=$$? ; \ + if test $$rs -eq 127; then \ + test -f $@ ; \ + else \ + test $$rs -eq 0 ; \ + fi -$(srcdir)/postgresql$(DISTSUFF)-setup.1: $(top_srcdir)/postgresql-setup.in - $(AM_V_GEN)$(HELP2MAN) --output=$@ $(top_srcdir)/postgresql$(DISTSUFF)-setup -N +dist_man_MANS = $(srcdir)/postgresql$(DISTSUFF)-setup.1 -CLEANFILES=$(man_MANS) $(srcdir)/*.1 +$(srcdir)/postgresql$(DISTSUFF)-setup.1: $(top_srcdir)/postgresql-setup.in + $(AM_V_GEN)$(HELP2MAN_RUN) |