automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: distributing man pages in HTML format


From: Bruno Haible
Subject: RFC: distributing man pages in HTML format
Date: Sun, 16 Nov 2003 19:04:28 +0100
User-agent: KMail/1.5

Hi Alexandre et al.,

automake has acknowledged the importance of the HTML format for documentation
through addition of the 'html' target. groff 1.17 can now produce quite good
HTML from manual pages in mandoc format.

Here's a suggestion for rules that would support this. Assuming Makefile.am
contains these lines

  html_HTMLMANS = prog.1.html func.3.html

automake would generate the equivalent of the following in Makefile.in:

==============================================================================
  docdir = @docdir@
  htmldir = $(docdir)

  html_HTMLMANS = prog.1.html func.3.html

  EXTRA_DIST += $(html_HTMLMANS)

  # groff 1.17 or newer.
  MAN2HTML = groff -mandoc -Thtml

  all-am: html-am
  install-data-am: install-html-am
  installdirs-am: installdirs-html-am
  uninstall-am: uninstall-html-am

  html-am: $(html_HTMLMANS)

  # Removing the CreationDate is to avoid unnecessary diffs and failures of
  # "make distcheck".
  prog.1.html: prog.1
        $(MAN2HTML) `if test -f prog.1; then echo .; else echo $(srcdir); 
fi`/prog.1 | sed -e '/CreationDate:/d' > t-$@
        mv t-$@ $@
  func.3.html: func.3
        $(MAN2HTML) `if test -f func.3; then echo .; else echo $(srcdir); 
fi`/func.3 | sed -e '/CreationDate:/d' > t-$@
        mv t-$@ $@

install-html-am:
        $(mkinstalldirs) $(DESTDIR)$(htmldir)
        for file in $(html_HTMLMANS); do \
          if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
          $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
        done

installdirs-html-am:
        $(mkinstalldirs) $(DESTDIR)$(htmldir)

uninstall-html-am:
        for file in $(html_HTMLMANS); do \
          $(RM) $(DESTDIR)$(htmldir)/$$file; \
        done
==============================================================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]