1 ## Makefile for the doc subdirectory of GNU libunistring.
2 ## Copyright (C) 2009, 2011 Free Software Foundation, Inc.
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.
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.
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/>.
17 ## Process this file with automake to produce Makefile.in.
19 AUTOMAKE_OPTIONS = 1.5 gnits
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>.
29 MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
30 MAKEINFOFLAGS = $(TEXINCLUDES) --no-split
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 unigbrk.texi uniwbrk.texi unilbrk.texi \
37 uninorm.texi unicase.texi uniregex.texi \
38 gpl.texi lgpl.texi fdl.texi
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
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)
54 cp $(srcdir)/version.texi $@
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
63 install-data-local: install-html
64 installdirs-local: installdirs-html
65 uninstall-local: uninstall-html
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
74 uninstall-html: uninstall-html-split
75 dist-html: dist-html-split
77 # CLEANFILES: libunistring.{dvi,ps,pdf,html} are already known to automake.
78 MAINTAINERCLEANFILES = libunistring_*.html
81 # Documentation in DVI format.
83 # Override of automake's definition:
84 #TEXI2DVI = @TEXI2DVI@
85 TEXI2DVI = @TEXI2DVI@ $(TEXINCLUDES)
87 # The install-dvi target is already defined by automake.
90 $(MKDIR_P) $(DESTDIR)$(dvidir)
93 $(RM) $(DESTDIR)$(dvidir)/libunistring.dvi
96 # Documentation in Postscript format.
98 # Override of automake's definition:
100 DVIPS = @DVIPS@ -D600
102 libunistring.ps: libunistring.dvi
103 $(DVIPS) -o $@ `if test -f libunistring.dvi; then echo libunistring.dvi; else echo $(srcdir)/libunistring.dvi; fi`
105 # The install-ps target is already defined by automake.
108 $(MKDIR_P) $(DESTDIR)$(psdir)
111 $(RM) $(DESTDIR)$(psdir)/libunistring.ps
114 # Documentation in Portable Document Format.
116 # Override of automake's definition:
117 #TEXI2PDF = @TEXI2DVI@ --pdf
118 TEXI2PDF = @TEXI2DVI@ --pdf $(TEXINCLUDES)
120 # The install-pdf target is already defined by automake.
123 $(MKDIR_P) $(DESTDIR)$(pdfdir)
126 $(RM) $(DESTDIR)$(pdfdir)/libunistring.pdf
129 # Documentation in HTML format.
131 TEXI2HTML = @PERL@ $(top_srcdir)/build-aux/texi2html
133 html-monolithic: libunistring.html
134 html-split: libunistring_toc.html
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`
141 libunistring_toc.html: libunistring.texi version.texi $(libunistring_TEXINFOS)
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` ;; \
148 && { mv libunistring/libunistring.html libunistring_toc.html; \
149 mv libunistring/*.html .; \
150 rmdir libunistring; \
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
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`; \
164 $(MKDIR_P) $(DESTDIR)$(htmldir)
166 uninstall-html-monolithic:
167 $(RM) $(DESTDIR)$(htmldir)/libunistring.html
169 uninstall-html-split:
170 $(RM) $(DESTDIR)$(htmldir)/libunistring_*.html
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
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; \