1 ## Makefile for the gettext-runtime/man subdirectory of GNU gettext
2 ## Copyright (C) 2001-2003, 2006, 2009 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 3 of the License, or
7 ## (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
17 ## Process this file with automake to produce Makefile.in.
21 AUTOMAKE_OPTIONS = 1.11 gnits
24 # A manual page for each of the bin_PROGRAMS in src/Makefile.am.
26 man_aux = gettext.x ngettext.x envsubst.x
28 # Likewise, plus additional manual pages for the libintl functions.
30 man_MAN1GEN = gettext.1 ngettext.1
31 man_MAN1IN = gettext.1.in ngettext.1.in
32 man_MAN1OTHER = envsubst.1
33 man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
34 man_MAN3 = gettext.3 ngettext.3 \
35 textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3
36 man_MAN3IN = gettext.3.in ngettext.3.in \
37 textdomain.3.in bindtextdomain.3.in bind_textdomain_codeset.3.in
38 man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
39 man_MANS = $(man_MAN1)
40 notrans_man_MANS = $(man_MAN3) $(man_MAN3LINK)
42 man_HTMLGEN = gettext.1.html ngettext.1.html
43 man_HTMLIN = gettext.1.html.in ngettext.1.html.in
46 gettext.3.html ngettext.3.html \
47 textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html
48 man_HTML = $(man_HTMLGEN) $(man_HTMLOTHER)
50 EXTRA_DIST += help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER)
51 CLEANFILES = $(man_MAN1GEN) $(man_HTMLGEN)
52 MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER)
57 # help2man 1.24 or newer.
58 HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
60 # groff 1.17 or newer.
61 MAN2HTML = groff -mandoc -Thtml
64 # We distribute both the man pages and their HTML equivalent.
65 # The user can generate the parts, via
70 install-data-local: install-html
71 installdirs-local: installdirs-html
72 uninstall-local: uninstall-html
77 # The progname.x files contain some extra information not found in the
78 # "progname --help" output.
80 gettext.1: gettext.1.in Makefile
81 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in > t-$@
83 ngettext.1: ngettext.1.in Makefile
84 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in > t-$@
87 gettext.1.in: gettext.x
88 IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/gettext$(EXEEXT) $(srcdir)/gettext.x gettext.1.in
89 ngettext.1.in: ngettext.x
90 IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
92 envsubst.1: envsubst.x
93 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
95 # Depend on version.sh to get version number changes.
96 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../version.sh
98 # Update them also during "make dist", in order to propagate added command
99 # line options that were added, even if version.sh didn't change.
102 $(MAKE) $(man_MAN1IN) $(man_MAN1OTHER) UPDATEMODE=--update
104 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
105 #distdir: update-man1
107 gettext.3: gettext.3.in $(top_srcdir)/../version.sh
108 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/gettext.3.in > t-$@
110 ngettext.3: ngettext.3.in $(top_srcdir)/../version.sh
111 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/ngettext.3.in > t-$@
113 textdomain.3: textdomain.3.in $(top_srcdir)/../version.sh
114 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/textdomain.3.in > t-$@
116 bindtextdomain.3: bindtextdomain.3.in $(top_srcdir)/../version.sh
117 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/bindtextdomain.3.in > t-$@
119 bind_textdomain_codeset.3: bind_textdomain_codeset.3.in $(top_srcdir)/../version.sh
120 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/bind_textdomain_codeset.3.in > t-$@
124 # Man pages in HTML format.
126 html-local: $(man_HTML)
128 gettext.1.html: gettext.1.html.in Makefile
129 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.html.in; then echo .; else echo $(srcdir); fi`/gettext.1.html.in > t-$@
131 ngettext.1.html: ngettext.1.html.in Makefile
132 sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.html.in; then echo .; else echo $(srcdir); fi`/ngettext.1.html.in > t-$@
135 gettext.1.html.in: gettext.1.in
136 $(MAN2HTML) `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in | sed -e '/CreationDate:/d' > t-$@
138 ngettext.1.html.in: ngettext.1.in
139 $(MAN2HTML) `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in | sed -e '/CreationDate:/d' > t-$@
142 envsubst.1.html: envsubst.1
143 $(MAN2HTML) `if test -f envsubst.1; then echo .; else echo $(srcdir); fi`/envsubst.1 | sed -e '/CreationDate:/d' > t-$@
146 gettext.3.html: gettext.3.in
147 $(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@
149 ngettext.3.html: ngettext.3.in
150 $(MAN2HTML) $(srcdir)/ngettext.3.in | sed -e '/CreationDate:/d' > t-$@
152 textdomain.3.html: textdomain.3.in
153 $(MAN2HTML) $(srcdir)/textdomain.3.in | sed -e '/CreationDate:/d' > t-$@
155 bindtextdomain.3.html: bindtextdomain.3.in
156 $(MAN2HTML) $(srcdir)/bindtextdomain.3.in | sed -e '/CreationDate:/d' > t-$@
158 bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in
159 $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in | sed -e '/CreationDate:/d' > t-$@
163 $(MKDIR_P) $(DESTDIR)$(htmldir)
164 for file in $(man_HTML); do \
165 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
166 $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
170 $(MKDIR_P) $(DESTDIR)$(htmldir)
173 for file in $(man_HTML); do \
174 $(RM) $(DESTDIR)$(htmldir)/$$file; \