Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / doc / Makefile.am
1 ## Makefile for the gettext-tools/doc subdirectory of GNU gettext
2 ## Copyright (C) 1995-1997, 2001-2007, 2009, 2015 Free Software
3 ## Foundation, Inc.
4 ##
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.
9 ##
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.
14 ##
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/>.
17
18 ## Process this file with automake to produce Makefile.in.
19
20 AUTOMAKE_OPTIONS = 1.2 gnits
21 EXTRA_DIST =
22 MOSTLYCLEANFILES =
23
24 # List of -I options referring to directories that contain texinfo
25 # sources used by this directory.
26 TEXINCLUDES = -I $(top_srcdir)/../gettext-runtime/doc
27
28 SED = sed
29 RM = rm -f
30
31 MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
32 MAKEINFOFLAGS = $(TEXINCLUDES) --no-split
33
34 info_TEXINFOS = gettext.texi
35 # List of texinfo sources @included by gettext.texi, excluding version.texi.
36 gettext_TEXINFOS = \
37   xgettext.texi msginit.texi msgmerge.texi msgcat.texi msgconv.texi \
38   msggrep.texi msgfilter.texi msguniq.texi msgcomm.texi msgcmp.texi \
39   msgattrib.texi msgen.texi msgexec.texi msgfmt.texi msgunfmt.texi \
40   gettextize.texi autopoint.texi iso-639.texi iso-639-2.texi iso-3166.texi \
41   gpl.texi lgpl.texi fdl.texi \
42   $(top_srcdir)/../gettext-runtime/doc/rt-gettext.texi \
43   $(top_srcdir)/../gettext-runtime/doc/rt-ngettext.texi \
44   $(top_srcdir)/../gettext-runtime/doc/rt-envsubst.texi
45
46 # The FAQ. To be edited with Mozilla.
47 # The tutorial. To be edited by hand.
48 doc_DATA = FAQ.html tutorial.html
49 EXTRA_DIST += $(doc_DATA)
50
51 EXTRA_DIST += \
52   iso-639.sed iso-639-2.sed iso-3166.sed \
53   ISO_639 ISO_639-2 ISO_3166 ISO_3166_de \
54   texi2html
55
56 iso-639.texi: ISO_639 iso-639.sed
57         $(SED) -f $(srcdir)/iso-639.sed $(srcdir)/ISO_639 > iso-639.tmp
58         rm -f $(srcdir)/iso-639.texi
59         mv iso-639.tmp $(srcdir)/iso-639.texi
60
61 iso-639-2.texi: ISO_639-2 iso-639-2.sed
62         $(SED) -f $(srcdir)/iso-639-2.sed $(srcdir)/ISO_639-2 > iso-639-2.tmp
63         rm -f $(srcdir)/iso-639-2.texi
64         mv iso-639-2.tmp $(srcdir)/iso-639-2.texi
65
66 iso-3166.texi: ISO_3166 iso-3166.sed
67         $(SED) -f $(srcdir)/iso-3166.sed $(srcdir)/ISO_3166 > iso-3166.tmp
68         rm -f $(srcdir)/iso-3166.texi
69         mv iso-3166.tmp $(srcdir)/iso-3166.texi
70
71 # The dependencies of stamp-vti generated by automake are incomplete.
72 # So we have to duplicate the entire rule which would otherwise be generated
73 # by automake.
74 $(srcdir)/stamp-vti: $(info_TEXINFOS) $(gettext_TEXINFOS) $(top_srcdir)/../.version
75         (dir=.; test -f ./gettext.texi || dir=$(srcdir); \
76         set `$(SHELL) $(top_srcdir)/../build-aux/mdate-sh $$dir/gettext.texi`; \
77         echo "@set UPDATED $$1 $$2 $$3"; \
78         echo "@set UPDATED-MONTH $$2 $$3"; \
79         echo "@set EDITION $(VERSION)"; \
80         echo "@set VERSION $(VERSION)"; \
81         echo "@set ARCHIVE-VERSION $(ARCHIVE_VERSION)") > vti.tmp
82         cmp -s vti.tmp version.texi \
83           || (echo "Updating version.texi"; \
84               cp vti.tmp version.texi)
85         rm -f vti.tmp
86         cp version.texi $@
87
88 # We distribute only the split HTML documentation.
89 # The user can generate the others, via
90 #   make gettext.ps
91 #   make gettext.pdf
92 #   make gettext.html
93
94 all-local: html-local
95 install-data-local: install-html
96 installdirs-local: installdirs-html
97 uninstall-local: uninstall-html
98 dist-hook: dist-html
99
100 html-local: html-split
101 # Override of automake's definition. The HTML files we want to distribute are
102 # not the ones that automake knows about, and we cannot define HTMLS to a value
103 # containing wildcards.
104 install-html: install-html-split
105         @:
106 uninstall-html: uninstall-html-split
107 dist-html: dist-html-split
108
109 # CLEANFILES: gettext.{dvi,ps,pdf,html} are already known to automake.
110 MAINTAINERCLEANFILES = gettext_*.html
111
112
113 # Documentation in DVI format.
114
115 # Override of automake's definition:
116 #TEXI2DVI = texi2dvi
117 TEXI2DVI = texi2dvi $(TEXINCLUDES)
118
119 # The install-dvi target is already defined by automake.
120
121 installdirs-dvi:
122         $(MKDIR_P) $(DESTDIR)$(dvidir)
123
124 uninstall-dvi:
125         $(RM) $(DESTDIR)$(dvidir)/gettext.dvi
126
127 # Temporary index files. automake removes only the predefined ones by itself.
128 MOSTLYCLEANFILES += \
129   gettext.am gettext.ams \
130   gettext.cp gettext.cps \
131   gettext.ef gettext.efs \
132   gettext.em gettext.ems \
133   gettext.ev gettext.evs \
134   gettext.fn gettext.fns \
135   gettext.kw gettext.kws \
136   gettext.op gettext.ops \
137   gettext.pg gettext.pgs \
138   gettext.vr gettext.vrs
139
140
141 # Documentation in Postscript format.
142
143 # Override of automake's definition:
144 #DVIPS = @DVIPS@
145 DVIPS = @DVIPS@ -D600
146
147 gettext.ps: gettext.dvi
148         $(DVIPS) -o $@ `if test -f gettext.dvi; then echo gettext.dvi; else echo $(srcdir)/gettext.dvi; fi`
149
150 # The install-ps target is already defined by automake.
151
152 installdirs-ps:
153         $(MKDIR_P) $(DESTDIR)$(psdir)
154
155 uninstall-ps:
156         $(RM) $(DESTDIR)$(psdir)/gettext.ps
157
158
159 # Documentation in Portable Document Format.
160
161 # Override of automake's definition:
162 #TEXI2PDF = @TEXI2PDF@
163 TEXI2PDF = @TEXI2PDF@ $(TEXINCLUDES)
164
165 # The install-pdf target is already defined by automake.
166
167 installdirs-pdf:
168         $(MKDIR_P) $(DESTDIR)$(pdfdir)
169
170 uninstall-pdf:
171         $(RM) $(DESTDIR)$(pdfdir)/gettext.pdf
172
173
174 # Documentation in HTML format.
175
176 TEXI2HTML = @PERL@ $(srcdir)/texi2html
177
178 html-monolithic: gettext.html
179 html-split: gettext_toc.html
180
181 # Override of automake's definition.
182 # We want to use texi2html, not makeinfo --html.
183 # Newer versions of texi2html also need the options --no-menu --no-sec-nav.
184 gettext.html: gettext.texi version.texi $(gettext_TEXINFOS)
185         $(TEXI2HTML) $(TEXINCLUDES) -number -monolithic `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi`
186
187 gettext_toc.html: gettext.texi version.texi $(gettext_TEXINFOS)
188         case "@PERL@" in \
189           *"/missing perl") \
190              $(TEXI2HTML) $(TEXINCLUDES) -number -split_chapter `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi` || exit 0 ;; \
191           *) $(RM) gettext_*.html ; \
192              $(TEXI2HTML) $(TEXINCLUDES) -number -split_chapter `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi` ;; \
193         esac
194
195 install-html-monolithic: gettext.html
196         $(MKDIR_P) $(DESTDIR)$(htmldir)
197         $(INSTALL_DATA) `if test -f gettext.html; then echo .; else echo $(srcdir); fi`/gettext.html $(DESTDIR)$(htmldir)/gettext.html
198
199 install-html-split: gettext_toc.html
200         $(MKDIR_P) $(DESTDIR)$(htmldir)
201         for file in `if test -f gettext_toc.html; then echo .; else echo $(srcdir); fi`/gettext_*.html; do \
202           $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/`basename $$file`; \
203         done
204
205 installdirs-html:
206         $(MKDIR_P) $(DESTDIR)$(htmldir)
207
208 uninstall-html-monolithic:
209         $(RM) $(DESTDIR)$(htmldir)/gettext.html
210
211 uninstall-html-split:
212         $(RM) $(DESTDIR)$(htmldir)/gettext_*.html
213
214 dist-html-monolithic:
215         $(MKDIR_P) $(distdir)/
216         file=gettext.html; \
217         if test -f $$file; then d=.; else d=$(srcdir); fi; \
218         cp -p $$d/$$file $(distdir)/$$file || exit 1
219
220 # We would like to put gettext_*.html into EXTRA_DIST, but it doesn't work.
221 dist-html-split: gettext_toc.html
222         $(MKDIR_P) $(distdir)/
223         file=gettext_toc.html; \
224         if test -f $$file; then d=.; else d=$(srcdir); fi; \
225         for file in `cd $$d && echo gettext_*.html`; do \
226           cp -p $$d/$$file $(distdir)/$$file || exit 1; \
227         done