1 ## Makefile for the gettext-runtime/man subdirectory of GNU gettext
2 ## Copyright (C) 2001-2003 Free Software Foundation, Inc.
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)
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.
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.
18 ## Process this file with automake to produce Makefile.in.
25 localedir = $(datadir)/locale
27 AUTOMAKE_OPTIONS = 1.2 gnits
30 # A manual page for each of the bin_PROGRAMS in src/Makefile.am.
32 man_aux = gettext.x ngettext.x envsubst.x
34 # Likewise, plus additional manual pages for the libintl functions.
36 man_MAN1GEN = gettext.1 ngettext.1
37 man_MAN1IN = gettext.1.in ngettext.1.in
38 man_MAN1OTHER = envsubst.1
39 man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
40 man_MAN3 = gettext.3 ngettext.3 \
41 textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3
42 man_MAN3IN = gettext.3.in ngettext.3.in \
43 textdomain.3.in bindtextdomain.3.in bind_textdomain_codeset.3.in
44 man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
45 man_MANS = $(man_MAN1) $(man_MAN3) $(man_MAN3LINK)
47 man_HTMLGEN = gettext.1.html ngettext.1.html
48 man_HTMLIN = gettext.1.html.in ngettext.1.html.in
51 gettext.3.html ngettext.3.html \
52 textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html
53 man_HTML = $(man_HTMLGEN) $(man_HTMLOTHER)
55 EXTRA_DIST += help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER)
56 CLEANFILES = $(man_MAN1GEN) $(man_HTMLGEN)
57 MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER)
62 # help2man 1.24 or newer.
63 HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
65 # groff 1.17 or newer.
66 MAN2HTML = groff -mandoc -Thtml
69 # We distribute both the man pages and their HTML equivalent.
70 # The user can generate the parts, via
75 install-data-local: install-html
76 installdirs-local: installdirs-html
77 uninstall-local: uninstall-html
82 # The progname.x files contain some extra information not found in the
83 # "progname --help" output.
85 gettext.1: gettext.1.in Makefile
86 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in > t-$@
88 ngettext.1: ngettext.1.in Makefile
89 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in > t-$@
92 gettext.1.in: gettext.x
93 IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/gettext$(EXEEXT) $(srcdir)/gettext.x gettext.1.in
94 ngettext.1.in: ngettext.x
95 IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
97 envsubst.1: envsubst.x
98 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
100 # Depend on version.sh to get version number changes.
101 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../version.sh
103 # Update them also during "make dist", in order to propagate added command
104 # line options that were added, even if version.sh didn't change.
107 $(MAKE) $(man_MAN1IN) $(man_MAN1OTHER) UPDATEMODE=--update
109 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
110 #distdir: update-man1
112 gettext.3: gettext.3.in $(top_srcdir)/../version.sh
113 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/gettext.3.in > t-$@
115 ngettext.3: ngettext.3.in $(top_srcdir)/../version.sh
116 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/ngettext.3.in > t-$@
118 textdomain.3: textdomain.3.in $(top_srcdir)/../version.sh
119 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/textdomain.3.in > t-$@
121 bindtextdomain.3: bindtextdomain.3.in $(top_srcdir)/../version.sh
122 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/bindtextdomain.3.in > t-$@
124 bind_textdomain_codeset.3: bind_textdomain_codeset.3.in $(top_srcdir)/../version.sh
125 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/bind_textdomain_codeset.3.in > t-$@
129 # Man pages in HTML format.
131 html-local: $(man_HTML)
133 gettext.1.html: gettext.1.html.in Makefile
134 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.html.in; then echo .; else echo $(srcdir); fi`/gettext.1.html.in > t-$@
136 ngettext.1.html: ngettext.1.html.in Makefile
137 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.html.in; then echo .; else echo $(srcdir); fi`/ngettext.1.html.in > t-$@
140 gettext.1.html.in: gettext.1.in
141 $(MAN2HTML) `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in | sed -e '/CreationDate:/d' > t-$@
143 ngettext.1.html.in: ngettext.1.in
144 $(MAN2HTML) `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in | sed -e '/CreationDate:/d' > t-$@
147 envsubst.1.html: envsubst.1
148 $(MAN2HTML) `if test -f envsubst.1; then echo .; else echo $(srcdir); fi`/envsubst.1 | sed -e '/CreationDate:/d' > t-$@
151 gettext.3.html: gettext.3.in
152 $(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@
154 ngettext.3.html: ngettext.3.in
155 $(MAN2HTML) $(srcdir)/ngettext.3.in | sed -e '/CreationDate:/d' > t-$@
157 textdomain.3.html: textdomain.3.in
158 $(MAN2HTML) $(srcdir)/textdomain.3.in | sed -e '/CreationDate:/d' > t-$@
160 bindtextdomain.3.html: bindtextdomain.3.in
161 $(MAN2HTML) $(srcdir)/bindtextdomain.3.in | sed -e '/CreationDate:/d' > t-$@
163 bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in
164 $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in | sed -e '/CreationDate:/d' > t-$@
168 $(mkinstalldirs) $(DESTDIR)$(htmldir)
169 for file in $(man_HTML); do \
170 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
171 $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
175 $(mkinstalldirs) $(DESTDIR)$(htmldir)
178 for file in $(man_HTML); do \
179 $(RM) $(DESTDIR)$(htmldir)/$$file; \
185 EXTRA_DIST += Makefile.vms
190 EXTRA_DIST += Makefile.msvc