Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-runtime / man / Makefile.am
1 ## Makefile for the gettext-runtime/man subdirectory of GNU gettext
2 ## Copyright (C) 2001-2003, 2006, 2009 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 3 of the License, or
7 ## (at your option) 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, see <http://www.gnu.org/licenses/>.
16
17 ## Process this file with automake to produce Makefile.in.
18
19 VERSION = @VERSION@
20
21 AUTOMAKE_OPTIONS = 1.11 gnits
22 EXTRA_DIST =
23
24 # A manual page for each of the bin_PROGRAMS in src/Makefile.am.
25
26 man_aux = gettext.x ngettext.x envsubst.x
27
28 # Likewise, plus additional manual pages for the libintl functions.
29
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)
41
42 man_HTMLGEN = gettext.1.html ngettext.1.html
43 man_HTMLIN = gettext.1.html.in ngettext.1.html.in
44 man_HTMLOTHER = \
45 envsubst.1.html \
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)
49
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)
53
54 PERL = @PERL@
55 RM = rm -f
56
57 # help2man 1.24 or newer.
58 HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
59
60 # groff 1.17 or newer.
61 MAN2HTML = groff -mandoc -Thtml
62
63
64 # We distribute both the man pages and their HTML equivalent.
65 # The user can generate the parts, via
66 #   make man
67 #   make html
68
69 all-local: html-local
70 install-data-local: install-html
71 installdirs-local: installdirs-html
72 uninstall-local: uninstall-html
73
74
75 # Man pages.
76
77 # The progname.x files contain some extra information not found in the
78 # "progname --help" output.
79
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-$@
82         mv 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-$@
85         mv t-$@ $@
86
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
91
92 envsubst.1: envsubst.x
93         $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
94
95 # Depend on version.sh to get version number changes.
96 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../version.sh
97
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.
100 UPDATEMODE =
101 update-man1:
102         $(MAKE) $(man_MAN1IN) $(man_MAN1OTHER) UPDATEMODE=--update
103         $(MAKE)
104 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
105 #distdir: update-man1
106
107 gettext.3: gettext.3.in $(top_srcdir)/../version.sh
108         sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/gettext.3.in > t-$@
109         mv t-$@ $@
110 ngettext.3: ngettext.3.in $(top_srcdir)/../version.sh
111         sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/ngettext.3.in > t-$@
112         mv t-$@ $@
113 textdomain.3: textdomain.3.in $(top_srcdir)/../version.sh
114         sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/textdomain.3.in > t-$@
115         mv t-$@ $@
116 bindtextdomain.3: bindtextdomain.3.in $(top_srcdir)/../version.sh
117         sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/bindtextdomain.3.in > t-$@
118         mv 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-$@
121         mv t-$@ $@
122
123
124 # Man pages in HTML format.
125
126 html-local: $(man_HTML)
127
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-$@
130         mv 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-$@
133         mv t-$@ $@
134
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-$@
137         mv 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-$@
140         mv t-$@ $@
141
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-$@
144         mv t-$@ $@
145
146 gettext.3.html: gettext.3.in
147         $(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@
148         mv t-$@ $@
149 ngettext.3.html: ngettext.3.in
150         $(MAN2HTML) $(srcdir)/ngettext.3.in | sed -e '/CreationDate:/d' > t-$@
151         mv t-$@ $@
152 textdomain.3.html: textdomain.3.in
153         $(MAN2HTML) $(srcdir)/textdomain.3.in | sed -e '/CreationDate:/d' > t-$@
154         mv t-$@ $@
155 bindtextdomain.3.html: bindtextdomain.3.in
156         $(MAN2HTML) $(srcdir)/bindtextdomain.3.in | sed -e '/CreationDate:/d' > t-$@
157         mv 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-$@
160         mv t-$@ $@
161
162 install-html-local:
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; \
167         done
168
169 installdirs-html:
170         $(mkdir_p) $(DESTDIR)$(htmldir)
171
172 uninstall-html:
173         for file in $(man_HTML); do \
174           $(RM) $(DESTDIR)$(htmldir)/$$file; \
175         done