+2001-07-28 Bruno Haible <haible@clisp.cons.org>
+
+ * x-to-1.in: New file.
+ * Makefile.am (localedir): New variable.
+ (man_MAN1GEN, man_MAN1IN, man_MAN1OTHER, man_MAN3LINK, man_HTMLGEN,
+ man_HTMLIN, man_HTMLOTHER): New variables.
+ (EXTRA_DIST): Remove gettext.1, ngettext.1, gettext.1.html,
+ ngettext.1.html. Add gettext.1.in, ngettext.1.in, gettext.1.html.in,
+ ngettext.1.html.in.
+ (MAINTAINERCLEANFILES): Likewise.
+ (CLEANFILES): New variable.
+ (SUFFIXES): Remove variable.
+ (.x.1): Remove rule.
+ (gettext.1, ngettext.1, gettext.1.in, ngettext.1.in, msgcmp.1,
+ msgfmt.1, msgmerge.1, msgunfmt.1, xgettext.1, msgcat.1, msgcomm.1,
+ msgconv.1, msgen.1, msgexec.1, msggrep.1, msguniq.1): New rules.
+ (gettext.1.html.in, ngettext.1.html.in): New rules.
+ (gettext.1.html, ngettext.1.html): Generated from corresponding .in
+ files.
+ (*.1.html): Remove CreationDate line from MAN2HTML output.
+
2001-07-21 Bruno Haible <haible@clisp.cons.org>
* msguniq.x: New file.
docdir = $(prefix)/doc/@PACKAGE@
htmldir = $(docdir)
+localedir = $(datadir)/locale
+
AUTOMAKE_OPTIONS = 1.2 gnits
# A manual page for each of the bin_PROGRAMS in src/Makefile.am.
# Likewise, plus additional manual pages for the libintl functions.
-man_MAN1 = gettext.1 ngettext.1 \
+man_MAN1GEN = gettext.1 ngettext.1
+man_MAN1IN = gettext.1.in ngettext.1.in
+man_MAN1OTHER = \
msgcmp.1 msgfmt.1 msgmerge.1 msgunfmt.1 xgettext.1 \
msgcat.1 msgcomm.1 msgconv.1 msgen.1 msgexec.1 msggrep.1 msguniq.1
+man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
man_MAN3 = gettext.3 ngettext.3 \
textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3
man_MAN3IN = gettext.3.in ngettext.3.in \
textdomain.3.in bindtextdomain.3.in bind_textdomain_codeset.3.in
-man_MANS = $(man_MAN1) $(man_MAN3) \
-dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
+man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
+man_MANS = $(man_MAN1) $(man_MAN3) $(man_MAN3LINK)
-man_HTML = gettext.1.html ngettext.1.html \
+man_HTMLGEN = gettext.1.html ngettext.1.html
+man_HTMLIN = gettext.1.html.in ngettext.1.html.in
+man_HTMLOTHER = \
msgcmp.1.html msgfmt.1.html msgmerge.1.html msgunfmt.1.html xgettext.1.html \
msgcat.1.html msgcomm.1.html msgconv.1.html msgen.1.html msgexec.1.html msggrep.1.html msguniq.1.html \
gettext.3.html ngettext.3.html \
textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html
+man_HTML = $(man_HTMLGEN) $(man_HTMLOTHER)
-EXTRA_DIST = help2man $(man_aux) $(man_MANS) $(man_MAN3IN) $(man_HTML)
-MAINTAINERCLEANFILES = $(man_MAN1) $(man_MAN3) $(man_HTML)
-SUFFIXES = .1 .x
+EXTRA_DIST = help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER)
+CLEANFILES = $(man_MAN1GEN) $(man_HTMLGEN)
+MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER)
PERL = @PERL@
RM = rm -f
# The progname.x files contain some extra information not found in the
# "progname --help" output.
-.x.1:
- @progname=`basename $@ .1`; \
- executable=../src/$$progname; \
- case "$(PERL)" in *"/missing perl") perlok=no;; *) perlok=yes;; esac; \
- if test @CROSS_COMPILING@ = no && test -f $$executable && test $$perlok = yes; then \
- echo "Updating man page $@"; \
- echo "$(HELP2MAN) --include=$$progname.x $$executable > $$progname.1"; \
- rm -f t-$$progname.1; \
- $(HELP2MAN) --include=$$progname.x $$executable > t-$$progname.1 || exit 1; \
- mv t-$$progname.1 $$progname.1; \
- else \
- echo "WARNING: The man page $@ cannot be updated yet."; \
- fi
+
+gettext.1: gettext.1.in Makefile
+ sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in > t-$@
+ mv t-$@ $@
+ngettext.1: ngettext.1.in Makefile
+ sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in > t-$@
+ mv t-$@ $@
+
+gettext.1.in: gettext.x
+ IN_HELP2MAN=1 $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/gettext$(EXEEXT) $(srcdir)/gettext.x gettext.1.in
+ngettext.1.in: ngettext.x
+ IN_HELP2MAN=1 $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
+
+msgcmp.1: msgcmp.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcmp$(EXEEXT) $(srcdir)/msgcmp.x msgcmp.1
+msgfmt.1: msgfmt.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgfmt$(EXEEXT) $(srcdir)/msgfmt.x msgfmt.1
+msgmerge.1: msgmerge.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgmerge$(EXEEXT) $(srcdir)/msgmerge.x msgmerge.1
+msgunfmt.1: msgunfmt.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgunfmt$(EXEEXT) $(srcdir)/msgunfmt.x msgunfmt.1
+xgettext.1: xgettext.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/xgettext$(EXEEXT) $(srcdir)/xgettext.x xgettext.1
+msgcat.1: msgcat.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcat$(EXEEXT) $(srcdir)/msgcat.x msgcat.1
+msgcomm.1: msgcomm.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcomm$(EXEEXT) $(srcdir)/msgcomm.x msgcomm.1
+msgconv.1: msgconv.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgconv$(EXEEXT) $(srcdir)/msgconv.x msgconv.1
+msgen.1: msgen.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgen$(EXEEXT) $(srcdir)/msgen.x msgen.1
+msgexec.1: msgexec.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgexec$(EXEEXT) $(srcdir)/msgexec.x msgexec.1
+msggrep.1: msggrep.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1
+msguniq.1: msguniq.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1
# Depend on configure.in to get version number changes.
$(man_MAN1): help2man $(top_srcdir)/configure.in
html: $(man_HTML)
-gettext.1.html: gettext.1
- $(MAN2HTML) `if test -f gettext.1; then echo .; else echo $(srcdir); fi`/gettext.1 > t-$@
+gettext.1.html: gettext.1.html.in Makefile
+ sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.html.in; then echo .; else echo $(srcdir); fi`/gettext.1.html.in > t-$@
+ mv t-$@ $@
+ngettext.1.html: ngettext.1.html.in Makefile
+ sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.html.in; then echo .; else echo $(srcdir); fi`/ngettext.1.html.in > t-$@
+ mv t-$@ $@
+
+gettext.1.html.in: gettext.1.in
+ $(MAN2HTML) `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
-ngettext.1.html: ngettext.1
- $(MAN2HTML) `if test -f ngettext.1; then echo .; else echo $(srcdir); fi`/ngettext.1 > t-$@
+ngettext.1.html.in: ngettext.1.in
+ $(MAN2HTML) `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
+
msgcmp.1.html: msgcmp.1
- $(MAN2HTML) `if test -f msgcmp.1; then echo .; else echo $(srcdir); fi`/msgcmp.1 > t-$@
+ $(MAN2HTML) `if test -f msgcmp.1; then echo .; else echo $(srcdir); fi`/msgcmp.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgfmt.1.html: msgfmt.1
- $(MAN2HTML) `if test -f msgfmt.1; then echo .; else echo $(srcdir); fi`/msgfmt.1 > t-$@
+ $(MAN2HTML) `if test -f msgfmt.1; then echo .; else echo $(srcdir); fi`/msgfmt.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgmerge.1.html: msgmerge.1
- $(MAN2HTML) `if test -f msgmerge.1; then echo .; else echo $(srcdir); fi`/msgmerge.1 > t-$@
+ $(MAN2HTML) `if test -f msgmerge.1; then echo .; else echo $(srcdir); fi`/msgmerge.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgunfmt.1.html: msgunfmt.1
- $(MAN2HTML) `if test -f msgunfmt.1; then echo .; else echo $(srcdir); fi`/msgunfmt.1 > t-$@
+ $(MAN2HTML) `if test -f msgunfmt.1; then echo .; else echo $(srcdir); fi`/msgunfmt.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
xgettext.1.html: xgettext.1
- $(MAN2HTML) `if test -f xgettext.1; then echo .; else echo $(srcdir); fi`/xgettext.1 > t-$@
+ $(MAN2HTML) `if test -f xgettext.1; then echo .; else echo $(srcdir); fi`/xgettext.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgcat.1.html: msgcat.1
- $(MAN2HTML) `if test -f msgcat.1; then echo .; else echo $(srcdir); fi`/msgcat.1 > t-$@
+ $(MAN2HTML) `if test -f msgcat.1; then echo .; else echo $(srcdir); fi`/msgcat.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgcomm.1.html: msgcomm.1
- $(MAN2HTML) `if test -f msgcomm.1; then echo .; else echo $(srcdir); fi`/msgcomm.1 > t-$@
+ $(MAN2HTML) `if test -f msgcomm.1; then echo .; else echo $(srcdir); fi`/msgcomm.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgconv.1.html: msgconv.1
- $(MAN2HTML) `if test -f msgconv.1; then echo .; else echo $(srcdir); fi`/msgconv.1 > t-$@
+ $(MAN2HTML) `if test -f msgconv.1; then echo .; else echo $(srcdir); fi`/msgconv.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgen.1.html: msgen.1
- $(MAN2HTML) `if test -f msgen.1; then echo .; else echo $(srcdir); fi`/msgen.1 > t-$@
+ $(MAN2HTML) `if test -f msgen.1; then echo .; else echo $(srcdir); fi`/msgen.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msgexec.1.html: msgexec.1
- $(MAN2HTML) `if test -f msgexec.1; then echo .; else echo $(srcdir); fi`/msgexec.1 > t-$@
+ $(MAN2HTML) `if test -f msgexec.1; then echo .; else echo $(srcdir); fi`/msgexec.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msggrep.1.html: msggrep.1
- $(MAN2HTML) `if test -f msggrep.1; then echo .; else echo $(srcdir); fi`/msggrep.1 > t-$@
+ $(MAN2HTML) `if test -f msggrep.1; then echo .; else echo $(srcdir); fi`/msggrep.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
msguniq.1.html: msguniq.1
- $(MAN2HTML) `if test -f msguniq.1; then echo .; else echo $(srcdir); fi`/msguniq.1 > t-$@
+ $(MAN2HTML) `if test -f msguniq.1; then echo .; else echo $(srcdir); fi`/msguniq.1 | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
gettext.3.html: gettext.3.in
- $(MAN2HTML) $(srcdir)/gettext.3.in > t-$@
+ $(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
ngettext.3.html: ngettext.3.in
- $(MAN2HTML) $(srcdir)/ngettext.3.in > t-$@
+ $(MAN2HTML) $(srcdir)/ngettext.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
textdomain.3.html: textdomain.3.in
- $(MAN2HTML) $(srcdir)/textdomain.3.in > t-$@
+ $(MAN2HTML) $(srcdir)/textdomain.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
bindtextdomain.3.html: bindtextdomain.3.in
- $(MAN2HTML) $(srcdir)/bindtextdomain.3.in > t-$@
+ $(MAN2HTML) $(srcdir)/bindtextdomain.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in
- $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in > t-$@
+ $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
install-html:
--- /dev/null
+#! /bin/sh
+#
+# Copyright (C) 2001 Free Software Foundation, Inc.
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# This program creates a program's manual from the .x skeleton and its --help
+# output.
+
+if test $# != 5; then
+ echo "Usage: x-to-1 PERL HELP2MAN executable program.x program.1" 1>&2
+ exit 1
+fi
+PERL="$1"
+HELP2MAN="$2"
+executable="$3"
+aux="$4"
+output="$5"
+
+progname=`basename $aux .x`
+case "$PERL" in *"/missing perl") perlok=no;; *) perlok=yes;; esac
+if test @CROSS_COMPILING@ = no && test -f $executable && test $perlok = yes; then
+ echo "Updating man page $output"
+ echo "$HELP2MAN --include=$aux $executable > $output"
+ rm -f t-$progname.1
+ $HELP2MAN --include=$aux $executable > t-$progname.1 || exit 1
+ mv t-$progname.1 $output
+else
+ echo "WARNING: The man page $output cannot be updated yet."
+fi