1 ## Makefile for the gettext-runtime/man subdirectory of GNU gettext
2 ## Copyright (C) 2001-2003, 2006, 2009, 2015 Free Software Foundation,
5 ## This program is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or
8 ## (at your option) any later version.
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ## Process this file with automake to produce Makefile.in.
22 AUTOMAKE_OPTIONS = 1.11 gnits
25 # A manual page for each of the bin_PROGRAMS in src/Makefile.am.
27 man_aux = gettext.x ngettext.x envsubst.x
29 # Likewise, plus additional manual pages for the libintl functions.
31 man_MAN1GEN = gettext.1 ngettext.1
32 man_MAN1IN = gettext.1.in ngettext.1.in
33 man_MAN1OTHER = envsubst.1
34 man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
35 man_MAN3 = gettext.3 ngettext.3 \
36 textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3
37 man_MAN3IN = gettext.3.in ngettext.3.in \
38 textdomain.3.in bindtextdomain.3.in bind_textdomain_codeset.3.in
39 man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
40 man_MANS = $(man_MAN1)
41 notrans_man_MANS = $(man_MAN3) $(man_MAN3LINK)
43 man_HTML1GEN = gettext.1.html ngettext.1.html
44 man_HTML1IN = gettext.1.html.in ngettext.1.html.in
45 man_HTML1OTHER = envsubst.1.html
46 man_HTML1 = $(man_HTML1GEN) $(man_HTML1OTHER)
47 man_HTML3 = gettext.3.html ngettext.3.html \
48 textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html
49 man_HTML = $(man_HTML1) $(man_HTML3)
51 EXTRA_DIST += help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) \
52 $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) \
53 $(man_HTML1IN) $(man_HTML1OTHER) $(man_HTML3)
54 CLEANFILES = $(man_MAN1GEN) $(man_HTML1GEN)
55 MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) \
56 $(man_HTML1IN) $(man_HTML1OTHER) $(man_HTML3)
61 # help2man 1.24 or newer.
62 HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
64 # groff 1.17 or newer.
65 MAN2HTML = groff -mandoc -Thtml
71 if test -f $${srcdir}$$m; then \
72 $(MAN2HTML) $${srcdir}$$m > t-$@ && \
73 sed -e '/CreationDate:/d' < t-$@ > t2-$@ && \
79 # We distribute both the man pages and their HTML equivalent.
80 # The user can generate the parts, via
85 install-data-local: install-html
86 installdirs-local: installdirs-html
87 uninstall-local: uninstall-html
92 # The progname.x files contain some extra information not found in the
93 # "progname --help" output. Each progname.1 depends on the source,
94 # not the binary; we don't need to regenerate the binary when any
95 # source file changes, only the main one.
97 $(man_MAN1GEN): Makefile
99 test -f ./$@.in || srcdir=$(srcdir)/; \
100 if test -f $${srcdir}$@.in; then \
101 sed -e 's|@''localedir''@|$(localedir)|g' $${srcdir}$@.in > t-$@ && \
105 gettext.1: gettext.1.in
106 ngettext.1: ngettext.1.in
108 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../.version
109 progname=`echo $@ | sed -e 's/\.in$$//' -e 's/\.1$$//'`; \
110 IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" \
111 ../src/$${progname}$(EXEEXT) $(srcdir)/$${progname}.x $@
113 gettext.1.in: gettext.x ../src/gettext.c
114 ngettext.1.in: ngettext.x ../src/ngettext.c
115 envsubst.1: envsubst.x ../src/envsubst.c
117 $(man_MAN3): $(top_srcdir)/../.version
118 sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/$@.in > t-$@ && \
121 gettext.3: gettext.3.in
122 ngettext.3: ngettext.3.in
123 textdomain.3: textdomain.3.in
124 bindtextdomain.3: bindtextdomain.3.in
125 bind_textdomain_codeset.3: bind_textdomain_codeset.3.in
128 # Man pages in HTML format.
130 html-local: $(man_HTML)
132 $(man_HTML1GEN): Makefile
134 test -f ./$@.in || srcdir=$(srcdir)/; \
135 if test -f $${srcdir}$@.in; then \
136 sed -e 's|@''localedir''@|$(localedir)|g' $${srcdir}$@.in > t-$@ && \
140 gettext.1.html: gettext.1.html.in
141 ngettext.1.html: ngettext.1.html.in
145 progname=`echo $@ | sed -e 's/\.1\.html\.in$$//'`; \
146 m=$${progname}.1.in; \
147 test -f ./$$m || srcdir=$(srcdir)/; \
150 gettext.1.html.in: gettext.1.in
151 ngettext.1.html.in: ngettext.1.in
155 progname=`echo $@ | sed -e 's/\.1\.html$$//'`; \
157 test -f ./$$m || srcdir=$(srcdir)/; \
160 envsubst.1.html: envsubst.1
164 progname=`echo $@ | sed -e 's/\.3\.html$$//'`; \
165 m=$${progname}.3.in; \
166 test -f ./$$m || srcdir=$(srcdir)/; \
169 gettext.3.html: gettext.3.in
170 ngettext.3.html: ngettext.3.in
171 textdomain.3.html: textdomain.3.in
172 bindtextdomain.3.html: bindtextdomain.3.in
173 bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in
176 $(MKDIR_P) $(DESTDIR)$(htmldir)
177 for file in $(man_HTML); do \
178 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
179 $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
183 $(MKDIR_P) $(DESTDIR)$(htmldir)
186 for file in $(man_HTML); do \
187 $(RM) $(DESTDIR)$(htmldir)/$$file; \