1## Makefile for the gettext-tools/man subdirectory of GNU gettext
2## Copyright (C) 2001-2003 Free Software Foundation, Inc.
3##
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2, or (at your option)
7## any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18## Process this file with automake to produce Makefile.in.
19
20VERSION = @VERSION@
21mandir = @mandir@
22docdir = @docdir@
23htmldir = $(docdir)
24
25localedir = $(datadir)/locale
26
27AUTOMAKE_OPTIONS = 1.2 gnits
28EXTRA_DIST =
29
30# A manual page for each of the bin_PROGRAMS in src/Makefile.am
31# and for each of the bin_SCRIPTS in misc/Makefile.am.
32
33man_aux = \
34msgcmp.x msgfmt.x msgmerge.x msgunfmt.x xgettext.x \
35msgattrib.x msgcat.x msgcomm.x msgconv.x msgen.x msgexec.x msgfilter.x msggrep.x msginit.x msguniq.x \
36gettextize.x autopoint.x
37
38# Likewise.
39
40man_MAN1OTHER = \
41msgcmp.1 msgfmt.1 msgmerge.1 msgunfmt.1 xgettext.1 \
42msgattrib.1 msgcat.1 msgcomm.1 msgconv.1 msgen.1 msgexec.1 msgfilter.1 msggrep.1 msginit.1 msguniq.1 \
43gettextize.1 autopoint.1
44man_MAN1 = $(man_MAN1OTHER)
45man_MANS = $(man_MAN1)
46
47man_HTMLOTHER = \
48msgcmp.1.html msgfmt.1.html msgmerge.1.html msgunfmt.1.html xgettext.1.html \
49msgattrib.1.html msgcat.1.html msgcomm.1.html msgconv.1.html msgen.1.html msgexec.1.html msgfilter.1.html msggrep.1.html msginit.1.html msguniq.1.html \
50gettextize.1.html autopoint.1.html
51man_HTML = $(man_HTMLOTHER)
52
53EXTRA_DIST += help2man $(man_aux) $(man_MAN1OTHER) $(man_HTMLOTHER) ChangeLog.0
54MAINTAINERCLEANFILES = $(man_MAN1OTHER) $(man_HTMLOTHER)
55
56PERL = @PERL@
57RM = rm -f
58
59# help2man 1.24 or newer.
60HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
61
62# groff 1.17 or newer.
63MAN2HTML = groff -mandoc -Thtml
64
65
66# We distribute both the man pages and their HTML equivalent.
67# The user can generate the parts, via
68#   make man
69#   make html
70
71all-local: html-local
72install-data-local: install-html
73installdirs-local: installdirs-html
74uninstall-local: uninstall-html
75
76
77# Man pages.
78
79# The progname.x files contain some extra information not found in the
80# "progname --help" output.
81
82msgcmp.1: msgcmp.x
83	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcmp$(EXEEXT) $(srcdir)/msgcmp.x msgcmp.1
84msgfmt.1: msgfmt.x
85	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgfmt$(EXEEXT) $(srcdir)/msgfmt.x msgfmt.1
86msgmerge.1: msgmerge.x
87	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgmerge$(EXEEXT) $(srcdir)/msgmerge.x msgmerge.1
88msgunfmt.1: msgunfmt.x
89	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgunfmt$(EXEEXT) $(srcdir)/msgunfmt.x msgunfmt.1
90xgettext.1: xgettext.x
91	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/xgettext$(EXEEXT) $(srcdir)/xgettext.x xgettext.1
92msgattrib.1: msgattrib.x
93	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgattrib$(EXEEXT) $(srcdir)/msgattrib.x msgattrib.1
94msgcat.1: msgcat.x
95	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcat$(EXEEXT) $(srcdir)/msgcat.x msgcat.1
96msgcomm.1: msgcomm.x
97	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcomm$(EXEEXT) $(srcdir)/msgcomm.x msgcomm.1
98msgconv.1: msgconv.x
99	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgconv$(EXEEXT) $(srcdir)/msgconv.x msgconv.1
100msgen.1: msgen.x
101	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgen$(EXEEXT) $(srcdir)/msgen.x msgen.1
102msgexec.1: msgexec.x
103	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgexec$(EXEEXT) $(srcdir)/msgexec.x msgexec.1
104msgfilter.1: msgfilter.x
105	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgfilter$(EXEEXT) $(srcdir)/msgfilter.x msgfilter.1
106msggrep.1: msggrep.x
107	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1
108msginit.1: msginit.x
109	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msginit$(EXEEXT) $(srcdir)/msginit.x msginit.1
110msguniq.1: msguniq.x
111	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1
112
113gettextize.1: gettextize.x
114	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/gettextize $(srcdir)/gettextize.x gettextize.1
115autopoint.1: autopoint.x
116	$(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/autopoint $(srcdir)/autopoint.x autopoint.1
117
118# Depend on version.sh to get version number changes.
119$(man_MAN1): help2man $(top_srcdir)/../version.sh
120
121# Update them also during "make dist", in order to propagate added command
122# line options that were added, even if version.sh didn't change.
123UPDATEMODE =
124update-man1:
125	$(MAKE) $(man_MAN1) UPDATEMODE=--update
126	$(MAKE)
127# Hidden from automake, but really activated. Works around an automake-1.5 bug.
128#distdir: update-man1
129
130
131# Man pages in HTML format.
132
133html-local: $(man_HTML)
134
135msgcmp.1.html: msgcmp.1
136	$(MAN2HTML) `if test -f msgcmp.1; then echo .; else echo $(srcdir); fi`/msgcmp.1 | sed -e '/CreationDate:/d' > t-$@
137	mv t-$@ $@
138msgfmt.1.html: msgfmt.1
139	$(MAN2HTML) `if test -f msgfmt.1; then echo .; else echo $(srcdir); fi`/msgfmt.1 | sed -e '/CreationDate:/d' > t-$@
140	mv t-$@ $@
141msgmerge.1.html: msgmerge.1
142	$(MAN2HTML) `if test -f msgmerge.1; then echo .; else echo $(srcdir); fi`/msgmerge.1 | sed -e '/CreationDate:/d' > t-$@
143	mv t-$@ $@
144msgunfmt.1.html: msgunfmt.1
145	$(MAN2HTML) `if test -f msgunfmt.1; then echo .; else echo $(srcdir); fi`/msgunfmt.1 | sed -e '/CreationDate:/d' > t-$@
146	mv t-$@ $@
147xgettext.1.html: xgettext.1
148	$(MAN2HTML) `if test -f xgettext.1; then echo .; else echo $(srcdir); fi`/xgettext.1 | sed -e '/CreationDate:/d' > t-$@
149	mv t-$@ $@
150msgattrib.1.html: msgattrib.1
151	$(MAN2HTML) `if test -f msgattrib.1; then echo .; else echo $(srcdir); fi`/msgattrib.1 | sed -e '/CreationDate:/d' > t-$@
152	mv t-$@ $@
153msgcat.1.html: msgcat.1
154	$(MAN2HTML) `if test -f msgcat.1; then echo .; else echo $(srcdir); fi`/msgcat.1 | sed -e '/CreationDate:/d' > t-$@
155	mv t-$@ $@
156msgcomm.1.html: msgcomm.1
157	$(MAN2HTML) `if test -f msgcomm.1; then echo .; else echo $(srcdir); fi`/msgcomm.1 | sed -e '/CreationDate:/d' > t-$@
158	mv t-$@ $@
159msgconv.1.html: msgconv.1
160	$(MAN2HTML) `if test -f msgconv.1; then echo .; else echo $(srcdir); fi`/msgconv.1 | sed -e '/CreationDate:/d' > t-$@
161	mv t-$@ $@
162msgen.1.html: msgen.1
163	$(MAN2HTML) `if test -f msgen.1; then echo .; else echo $(srcdir); fi`/msgen.1 | sed -e '/CreationDate:/d' > t-$@
164	mv t-$@ $@
165msgexec.1.html: msgexec.1
166	$(MAN2HTML) `if test -f msgexec.1; then echo .; else echo $(srcdir); fi`/msgexec.1 | sed -e '/CreationDate:/d' > t-$@
167	mv t-$@ $@
168msgfilter.1.html: msgfilter.1
169	$(MAN2HTML) `if test -f msgfilter.1; then echo .; else echo $(srcdir); fi`/msgfilter.1 | sed -e '/CreationDate:/d' > t-$@
170	mv t-$@ $@
171msggrep.1.html: msggrep.1
172	$(MAN2HTML) `if test -f msggrep.1; then echo .; else echo $(srcdir); fi`/msggrep.1 | sed -e '/CreationDate:/d' > t-$@
173	mv t-$@ $@
174msginit.1.html: msginit.1
175	$(MAN2HTML) `if test -f msginit.1; then echo .; else echo $(srcdir); fi`/msginit.1 | sed -e '/CreationDate:/d' > t-$@
176	mv t-$@ $@
177msguniq.1.html: msguniq.1
178	$(MAN2HTML) `if test -f msguniq.1; then echo .; else echo $(srcdir); fi`/msguniq.1 | sed -e '/CreationDate:/d' > t-$@
179	mv t-$@ $@
180gettextize.1.html: gettextize.1
181	$(MAN2HTML) `if test -f gettextize.1; then echo .; else echo $(srcdir); fi`/gettextize.1 | sed -e '/CreationDate:/d' > t-$@
182	mv t-$@ $@
183autopoint.1.html: autopoint.1
184	$(MAN2HTML) `if test -f autopoint.1; then echo .; else echo $(srcdir); fi`/autopoint.1 | sed -e '/CreationDate:/d' > t-$@
185	mv t-$@ $@
186
187install-html:
188	$(mkinstalldirs) $(DESTDIR)$(htmldir)
189	for file in $(man_HTML); do \
190	  if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
191	  $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
192	done
193
194installdirs-html:
195	$(mkinstalldirs) $(DESTDIR)$(htmldir)
196
197uninstall-html:
198	for file in $(man_HTML); do \
199	  $(RM) $(DESTDIR)$(htmldir)/$$file; \
200	done
201
202
203# VMS support.
204
205EXTRA_DIST += Makefile.vms
206
207
208# Woe32 support.
209
210EXTRA_DIST += Makefile.msvc
211