Makefile.am revision a4e54154
1# -*- encoding: utf-8 -*-
2#
3# fontconfig/doc/Makefile.am
4#
5# Copyright © 2003 Keith Packard
6#
7# Permission to use, copy, modify, distribute, and sell this software and its
8# documentation for any purpose is hereby granted without fee, provided that
9# the above copyright notice appear in all copies and that both that
10# copyright notice and this permission notice appear in supporting
11# documentation, and that the name of the author(s) not be used in
12# advertising or publicity pertaining to distribution of the software without
13# specific, written prior permission.  The authors make no
14# representations about the suitability of this software for any purpose.  It
15# is provided "as is" without express or implied warranty.
16#
17# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23# PERFORMANCE OF THIS SOFTWARE.
24
25NULL =
26EXTRA_DIST =			\
27	$(BUILT_DOCS)		\
28	$(DOC_FUNCS_FNCS)	\
29	$(HTML_DIR)/*		\
30	$(SGML_FILES)		\
31	$(check_SCRIPTS)	\
32	confdir.sgml.in		\
33	func.sgml		\
34	$(NULL)
35BUILT_SOURCES =			\
36	$(DOC_FUNCS_SGML)	\
37	$(NULL)
38
39if USEDOCBOOK
40maintainerdoccleanfiles =	\
41	$(NULL)
42cleandocfiles =			\
43	$(BUILT_DOCS)		\
44	$(NULL)
45else
46maintainerdoccleanfiles =	\
47	$(BUILT_DOCS)		\
48	$(NULL)
49cleandocfiles =			\
50	$(NULL)
51endif
52MAINTAINERCLEANFILES =			\
53	$(DOC_FUNCS_SGML)		\
54	$(maintainerdoccleanfiles)	\
55	$(NULL)
56CLEANFILES =			\
57	$(cleandocfiles)	\
58	$(LOCAL_SGML_FILES)	\
59	confdir.sgml		\
60	func.refs		\
61	$(NULL)
62SUFFIXES =	\
63	.fncs	\
64	.sgml	\
65	.txt	\
66	.html	\
67	$(NULL)
68TESTS =				\
69	check-missing-doc	\
70	$(NULL)
71TESTS_ENVIRONMENT = \
72	top_srcdir=${top_srcdir}; export top_srcdir; \
73	$(NULL)
74LOG_COMPILER = sh
75#
76DOC2HTML = docbook2html
77DOC2TXT  = docbook2txt
78DOC2MAN  = docbook2man
79DOC2PDF  = docbook2pdf
80
81DOC_FUNCS_FNCS =		\
82	fcatomic.fncs		\
83	fcblanks.fncs		\
84	fccache.fncs		\
85	fccharset.fncs		\
86	fcconfig.fncs		\
87	fcconstant.fncs		\
88	fcdircache.fncs		\
89	fcfile.fncs		\
90	fcfontset.fncs		\
91	fcformat.fncs		\
92	fcfreetype.fncs		\
93	fcinit.fncs		\
94	fclangset.fncs		\
95	fcmatrix.fncs		\
96	fcobjectset.fncs	\
97	fcobjecttype.fncs	\
98	fcpattern.fncs		\
99	fcrange.fncs		\
100	fcstring.fncs		\
101	fcstrset.fncs		\
102	fcvalue.fncs		\
103	fcweight.fncs		\
104	$(NULL)
105SGML_FILES =			\
106	fontconfig-user.sgml	\
107	fontconfig-devel.sgml	\
108	$(NULL)
109LOCAL_SGML_FILES =			\
110	local-fontconfig-user.sgml	\
111	local-fontconfig-devel.sgml	\
112	$(NULL)
113
114DOC_FUNCS_SGML = $(DOC_FUNCS_FNCS:.fncs=.sgml)
115BUILT_DOCS =		\
116	$(HTML_FILES)	\
117	$(PDF_FILES)	\
118	$(TXT_FILES)	\
119	$(man3_MANS)	\
120	$(man5_MANS)	\
121	$(NULL)
122DOCS_DEPS =			\
123	$(DOC_FUNCS_SGML)	\
124	confdir.sgml		\
125	version.sgml		\
126	$(NULL)
127
128TXT_FILES = $(SGML_FILES:.sgml=.txt)
129PDF_FILES = $(SGML_FILES:.sgml=.pdf)
130HTML_FILES =			\
131	fontconfig-user.html	\
132	$(NULL)
133HTML_DIR = fontconfig-devel
134#
135noinst_PROGRAMS =	\
136	$(NULL)
137noinst_SCRIPTS =		\
138	edit-sgml.py		\
139	$(NULL)
140##
141check_SCRIPTS =			\
142	check-missing-doc	\
143	$(NULL)
144#
145man3_MANS =		\
146	$(DOCMAN3)	\
147	$(NULL)
148man5_MANS =		\
149	fonts-conf.5	\
150	$(NULL)
151#
152doc_DATA =		\
153	$(TXT_FILES)	\
154	$(PDF_FILES)	\
155	$(HTML_FILES)	\
156	$(NULL)
157#
158htmldocdir = $(docdir)/$(HTML_DIR)
159htmldoc_DATA =		\
160	$(NULL)
161
162if USEDOCBOOK
163BUILT_SOURCES +=		\
164	$(LOCAL_SGML_FILES)	\
165	$(NULL)
166htmldoc_DATA += $(HTML_DIR)/*
167
168##
169.fncs.sgml:
170	$(AM_V_GEN) $(RM) $@; \
171	$(PYTHON) $(srcdir)/edit-sgml.py $(srcdir)/func.sgml '$(srcdir)/$*.fncs' $*.sgml
172.sgml.txt:
173	$(AM_V_GEN) $(RM) $@; \
174	$(DOC2TXT) $*.sgml
175.sgml.pdf:
176	$(AM_V_GEN) $(RM) $@; \
177	$(DOC2PDF) $*.sgml
178.sgml.html:
179	$(AM_V_GEN) $(RM) $@; \
180	$(DOC2HTML) -u $*.sgml > $@
181##
182fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
183	$(AM_V_GEN) $(RM) $@; \
184	$(DOC2MAN) local-fontconfig-user.sgml && \
185	$(RM) manpage.*
186##
187$(man3_MANS): func.refs
188func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
189	$(AM_V_GEN) $(RM) $@; \
190	$(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
191	mv devel-man/manpage.refs func.refs &&	\
192	mv devel-man/*.3 . &&			\
193	$(RM) devel-man/manpage.* &&		\
194	rmdir devel-man || rm $@ || :
195confdir.sgml: $(srcdir)/confdir.sgml.in
196	$(AM_V_GEN) sed -e 's,@BASECONFIGDIR\@,${BASECONFIGDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
197##
198$(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) $(srcdir)/edit-sgml.py $(srcdir)/func.sgml
199$(TXT_FILES): $(DOCS_DEPS)
200$(PDF_FILES): $(DOCS_DEPS)
201$(HTML_FILES): $(DOCS_DEPS)
202$(HTML_DIR)/*: $(HTML_DIR)
203$(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
204	$(AM_V_GEN) $(RM) -r $@; \
205	$(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
206local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
207	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;	\
208	[ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
209local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
210	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@;	\
211	[ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
212#
213all-local: $(BUILT_DOCS) $(HTML_DIR)/*
214clean-local:
215	$(RM) -r $(HTML_DIR) devel-man
216	[ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
217dist-local-check-docs-enabled:
218	@true
219else
220htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
221.fncs.sgml:
222	$(AM_V_GEN) $(RM) $@; \
223	touch -r $< $@
224all-local:
225clean-local:
226dist-local-check-docs-enabled:
227	@echo "*** --enable-man must be used in order to make dist"
228	@false
229endif
230
231# force doc rebuild after configure
232dist-hook-local: dist-local-check-docs-enabled
233
234-include $(top_srcdir)/git.mk
235