ac3480c8e8346aea8c5552dabb1e78a77bdd235e
[platform/upstream/libunistring.git] / doc / Makefile.am
1 ## Makefile for the doc subdirectory of GNU libunistring.
2 ## Copyright (C) 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.5 gnits
20 EXTRA_DIST =
21 MOSTLYCLEANFILES =
22
23 # List of -I options referring to directories that contain texinfo sources
24 # used by this directory.
25 # Should contain at least one -I option, to work around a bug in texi2dvi 1.13,
26 # see <http://lists.gnu.org/archive/html/bug-automake/2009-04/msg00029.html>.
27 TEXINCLUDES = -I .
28
29 MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
30 MAKEINFOFLAGS = $(TEXINCLUDES) --no-split
31
32 info_TEXINFOS = libunistring.texi
33 # List of texinfo sources @included by libunistring.texi, excluding version.texi.
34 libunistring_TEXINFOS = \
35   unitypes.texi unistr.texi uniconv.texi unistdio.texi uniname.texi \
36   unictype.texi uniwidth.texi uniwbrk.texi unilbrk.texi uninorm.texi \
37   unicase.texi uniregex.texi \
38   gpl.texi lgpl.texi fdl.texi
39
40 # The dependencies of stamp-vti generated by automake are incomplete.
41 # So we have to duplicate the entire rule which would otherwise be generated
42 # by automake.
43 $(srcdir)/stamp-vti: $(info_TEXINFOS) $(libunistring_TEXINFOS) $(top_srcdir)/version.sh
44         (dir=.; test -f ./libunistring.texi || dir=$(srcdir); \
45         set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/libunistring.texi`; \
46         echo "@set UPDATED $$1 $$2 $$3"; \
47         echo "@set UPDATED-MONTH $$2 $$3"; \
48         echo "@set EDITION $(VERSION)"; \
49         echo "@set VERSION $(VERSION)") > vti.tmp
50         cmp -s vti.tmp $(srcdir)/version.texi \
51           || (echo "Updating $(srcdir)/version.texi"; \
52               cp vti.tmp $(srcdir)/version.texi)
53         rm -f vti.tmp
54         cp $(srcdir)/version.texi $@
55
56 # We distribute only the split HTML documentation.
57 # The user can generate the others, via
58 #   make libunistring.ps
59 #   make libunistring.pdf
60 #   make libunistring.html
61
62 all-local: html-local
63 install-data-local: install-html
64 installdirs-local: installdirs-html
65 uninstall-local: uninstall-html
66 dist-hook: dist-html
67
68 html-local: html-split
69 # Override of automake's definition. The HTML files we want to distribute are
70 # not the ones that automake knows about, and we cannot define HTMLS to a value
71 # containing wildcards.
72 install-html: install-html-split
73         @:
74 uninstall-html: uninstall-html-split
75 dist-html: dist-html-split
76
77 # CLEANFILES: libunistring.{dvi,ps,pdf,html} are already known to automake.
78 MAINTAINERCLEANFILES = libunistring_*.html
79
80
81 # Documentation in DVI format.
82
83 # Override of automake's definition:
84 #TEXI2DVI = @TEXI2DVI@
85 TEXI2DVI = @TEXI2DVI@ $(TEXINCLUDES)
86
87 # The install-dvi target is already defined by automake.
88
89 installdirs-dvi:
90         $(mkdir_p) $(DESTDIR)$(dvidir)
91
92 uninstall-dvi:
93         $(RM) $(DESTDIR)$(dvidir)/libunistring.dvi
94
95
96 # Documentation in Postscript format.
97
98 # Override of automake's definition:
99 #DVIPS = @DVIPS@
100 DVIPS = @DVIPS@ -D600
101
102 libunistring.ps: libunistring.dvi
103         $(DVIPS) -o $@ `if test -f libunistring.dvi; then echo libunistring.dvi; else echo $(srcdir)/libunistring.dvi; fi`
104
105 # The install-ps target is already defined by automake.
106
107 installdirs-ps:
108         $(mkdir_p) $(DESTDIR)$(psdir)
109
110 uninstall-ps:
111         $(RM) $(DESTDIR)$(psdir)/libunistring.ps
112
113
114 # Documentation in Portable Document Format.
115
116 # Override of automake's definition:
117 #TEXI2PDF = @TEXI2DVI@ --pdf
118 TEXI2PDF = @TEXI2DVI@ --pdf $(TEXINCLUDES)
119
120 # The install-pdf target is already defined by automake.
121
122 installdirs-pdf:
123         $(mkdir_p) $(DESTDIR)$(pdfdir)
124
125 uninstall-pdf:
126         $(RM) $(DESTDIR)$(pdfdir)/libunistring.pdf
127
128
129 # Documentation in HTML format.
130
131 TEXI2HTML = @PERL@ $(top_srcdir)/build-aux/texi2html
132
133 html-monolithic: libunistring.html
134 html-split: libunistring_toc.html
135
136 # Override of automake's definition.
137 # We want to use texi2html, not makeinfo --html.
138 libunistring.html: libunistring.texi version.texi $(libunistring_TEXINFOS)
139         $(TEXI2HTML) $(TEXINCLUDES) -no-sec-nav -no-menu -toc-links -number -monolithic `if test -f libunistring.texi; then echo libunistring.texi; else echo $(srcdir)/libunistring.texi; fi`
140
141 libunistring_toc.html: libunistring.texi version.texi $(libunistring_TEXINFOS)
142         case "@PERL@" in \
143           *"/missing perl") \
144              $(TEXI2HTML) $(TEXINCLUDES) -no-sec-nav -no-menu -toc-links -number -split_chapter `if test -f libunistring.texi; then echo libunistring.texi; else echo $(srcdir)/libunistring.texi; fi` || exit 0 ;; \
145           *) $(RM) libunistring_*.html ; \
146              $(TEXI2HTML) $(TEXINCLUDES) -no-sec-nav -no-menu -toc-links -number -split_chapter `if test -f libunistring.texi; then echo libunistring.texi; else echo $(srcdir)/libunistring.texi; fi` ;; \
147         esac \
148         && { mv libunistring/libunistring.html libunistring_toc.html; \
149              mv libunistring/*.html .; \
150              rmdir libunistring; \
151            }
152
153 install-html-monolithic: libunistring.html
154         $(mkdir_p) $(DESTDIR)$(htmldir)
155         $(INSTALL_DATA) `if test -f libunistring.html; then echo .; else echo $(srcdir); fi`/libunistring.html $(DESTDIR)$(htmldir)/libunistring.html
156
157 install-html-split: libunistring_toc.html
158         $(mkdir_p) $(DESTDIR)$(htmldir)
159         for file in `if test -f libunistring_toc.html; then echo .; else echo $(srcdir); fi`/libunistring_*.html; do \
160           $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/`basename $$file`; \
161         done
162
163 installdirs-html:
164         $(mkdir_p) $(DESTDIR)$(htmldir)
165
166 uninstall-html-monolithic:
167         $(RM) $(DESTDIR)$(htmldir)/libunistring.html
168
169 uninstall-html-split:
170         $(RM) $(DESTDIR)$(htmldir)/libunistring_*.html
171
172 dist-html-monolithic:
173         $(mkdir_p) $(distdir)/
174         file=libunistring.html; \
175         if test -f $$file; then d=.; else d=$(srcdir); fi; \
176         cp -p $$d/$$file $(distdir)/$$file || exit 1
177
178 # We would like to put libunistring_*.html into EXTRA_DIST, but it doesn't work.
179 dist-html-split: libunistring_toc.html
180         $(mkdir_p) $(distdir)/
181         file=libunistring_toc.html; \
182         if test -f $$file; then d=.; else d=$(srcdir); fi; \
183         for file in `cd $$d && echo libunistring_*.html`; do \
184           cp -p $$d/$$file $(distdir)/$$file || exit 1; \
185         done