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