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