chiark / gitweb /
htmlman now deals with getting filenames right. Also quietens an
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 17 Jan 2010 18:08:09 +0000 (18:08 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 17 Jan 2010 18:08:09 +0000 (18:08 +0000)
Automake warning.

doc/Makefile.am
scripts/htmlman

index eaad306eb16f9c015d2daa52ce4df87c68f1a9a5..64e6141882041c440180e34c09e95727f2502d13 100644 (file)
@@ -35,19 +35,31 @@ SEDFILES=disorder.1 disorderd.8 disorder_config.5 \
 
 include ${top_srcdir}/scripts/sedfiles.make
 
-HTMLMAN=$(foreach man,$(man_MANS),$(man).html)
-$(HTMLMAN) : %.html : % $(top_srcdir)/scripts/htmlman
-       rm -f $@.new
-       $(top_srcdir)/scripts/htmlman $< >$@.new
-       chmod 444 $@.new
-       mv -f $@.new $@
+HTMLMAN=disorderd.8.html disorder.1.html disorder.3.html               \
+disorder_config.5.html disorder-dump.8.html disorder_protocol.5.html   \
+disorder-deadlock.8.html disorder-rescan.8.html disobedience.1.html    \
+disorderfm.1.html disorder-speaker.8.html disorder-playrtp.1.html      \
+disorder-normalize.8.html disorder-decode.8.html disorder-stats.8.html \
+disorder-dbupgrade.8.html disorder_templates.5.html                    \
+disorder_actions.5.html disorder_options.5.html disorder.cgi.8.html    \
+disorder_preferences.5.html disorder-choose.8.html
 
-TMPLMAN=$(foreach man,$(man_MANS),$(man).tmpl)
-$(TMPLMAN) : %.tmpl : % $(top_srcdir)/scripts/htmlman
-       rm -f $@.new
-       $(top_srcdir)/scripts/htmlman -stdhead $< >$@.new
-       chmod 444 $@.new
-       mv -f $@.new $@
+$(HTMLMAN): disorderd.8.html
+disorderd.8.html: $(man_MANS)
+       $(top_srcdir)/scripts/htmlman -- $^
+
+TMPLMAN=disorderd.8.tmpl disorder.1.tmpl disorder.3.tmpl               \
+disorder_config.5.tmpl disorder-dump.8.tmpl disorder_protocol.5.tmpl   \
+disorder-deadlock.8.tmpl disorder-rescan.8.tmpl disobedience.1.tmpl    \
+disorderfm.1.tmpl disorder-speaker.8.tmpl disorder-playrtp.1.tmpl      \
+disorder-normalize.8.tmpl disorder-decode.8.tmpl disorder-stats.8.tmpl \
+disorder-dbupgrade.8.tmpl disorder_templates.5.tmpl                    \
+disorder_actions.5.tmpl disorder_options.5.tmpl disorder.cgi.8.tmpl    \
+disorder_preferences.5.tmpl disorder-choose.8.tmpl
+
+$(TMPLMAN): disorderd.8.tmpl
+disorderd.8.tmpl: $(man_MANS)
+       $(top_srcdir)/scripts/htmlman -stdhead -extension tmpl -- $^
 
 disorder_templates.5.in: disorder_templates.5.head disorder_templates.5.tail \
                $(top_srcdir)/lib/macros-builtin.c \
index 21452dce500c0df6a45e6cba9ff887befc6ecd34..9a09c78de8c2b01ae6365d13d9ee502bbb5a6977 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 #
 # This file is part of DisOrder
-# Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
+# Copyright (C) 2004, 2005, 2007, 2008, 2010 Richard Kettlewell
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 set -e
 
 stdhead=false
+extension="html"
 
 while test $# -gt 0; do
   case "$1" in
   -stdhead )
     stdhead=true
     ;;
+  -extension )
+    shift
+    extension=$1
+    ;;
+  -- )
+    shift
+    break
+    ;;
   -* )
     echo >&2 "ERROR: unknown option $1"
     exit 1
     ;;
   * )
     break
+    ;;
   esac
   shift
 done
 
-title=$(basename $1)
-
-echo "<html>"
-echo " <head>"
-if $stdhead; then
-  echo "@quiethead@#"
-fi
-echo "  <title>$title</title>"
-echo " </head>"
-echo " <body>"
-if $stdhead; then
-  echo "@stdmenu{}@#"
-fi
-printf "   <pre class=manpage>"
-# this is kind of painful using only BREs
-nroff -Tascii -man "$1" | ${GNUSED} \
-                      '1d;$d;
-                       1,/./{/^$/d};
-                       s/&/\&amp;/g;
-                       s/</\&lt;/g;
-                       s/>/\&gt;/g;
-                       s/@/\&#64;/g;
-                       s!\(.\)\b\1!<b>\1</b>!g;
-                       s!\(&[#0-9a-z][0-9a-z]*;\)\b\1!<b>\1</b>!g;
-                       s!_\b\(.\)!<i>\1</i>!g;
-                       s!_\b\(&[#0-9a-z][0-9a-z]*;\)!<i>\1</i>!g;
-                       s!</\([bi]\)><\1>!!g'
-echo "</pre>"
-if $stdhead; then
-  echo "@credits"
-fi
-echo " </body>"
-echo "</html>"
+for page; do
+  title=$(basename $page)
+  output=$page.$extension
+  echo "$page -> $output" >&2
+  exec > $output.new
+  echo "<html>"
+  echo " <head>"
+  if $stdhead; then
+    echo "@quiethead@#"
+  fi
+  echo "  <title>$title</title>"
+  echo " </head>"
+  echo " <body>"
+  if $stdhead; then
+    echo "@stdmenu{}@#"
+  fi
+  printf "   <pre class=manpage>"
+  # this is kind of painful using only BREs
+  nroff -Tascii -man "$page" | ${GNUSED} \
+                        '1d;$d;
+                         1,/./{/^$/d};
+                         s/&/\&amp;/g;
+                         s/</\&lt;/g;
+                         s/>/\&gt;/g;
+                         s/@/\&#64;/g;
+                         s!\(.\)\b\1!<b>\1</b>!g;
+                         s!\(&[#0-9a-z][0-9a-z]*;\)\b\1!<b>\1</b>!g;
+                         s!_\b\(.\)!<i>\1</i>!g;
+                         s!_\b\(&[#0-9a-z][0-9a-z]*;\)!<i>\1</i>!g;
+                         s!</\([bi]\)><\1>!!g'
+  echo "</pre>"
+  if $stdhead; then
+    echo "@credits"
+  fi
+  echo " </body>"
+  echo "</html>"
+  mv $output.new $output
+done