Makefile.am 5.64 KB
Newer Older
Akira TAGOH's avatar
Akira TAGOH committed
1
# -*- encoding: utf-8 -*-
2
#
Behdad Esfahbod's avatar
Behdad Esfahbod committed
3
# fontconfig/doc/Makefile.am
4
5
6
7
8
9
10
#
# Copyright © 2003 Keith Packard
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# 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
15
16
# representations about the suitability of this software for any purpose.  It
# is provided "as is" without express or implied warranty.
#
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
21
22
23
24
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

Akira TAGOH's avatar
Akira TAGOH committed
25
26
27
28
29
30
31
32
33
34
NULL =
EXTRA_DIST =			\
	$(BUILT_DOCS)		\
	$(DOC_FUNCS_FNCS)	\
	$(HTML_DIR)/*		\
	$(SGML_FILES)		\
	$(check_SCRIPTS)	\
	confdir.sgml.in		\
	func.sgml		\
	$(NULL)
35
36
37
38
BUILT_SOURCES =			\
	$(DOC_FUNCS_SGML)	\
	$(NULL)

39
40
if USEDOCBOOK
maintainerdoccleanfiles =	\
Akira TAGOH's avatar
Akira TAGOH committed
41
	$(NULL)
42
43
44
45
46
cleandocfiles =			\
	$(BUILT_DOCS)		\
	$(NULL)
else
maintainerdoccleanfiles =	\
Akira TAGOH's avatar
Akira TAGOH committed
47
	$(BUILT_DOCS)		\
48
49
50
51
52
53
54
55
56
57
	$(NULL)
cleandocfiles =			\
	$(NULL)
endif
MAINTAINERCLEANFILES =			\
	$(DOC_FUNCS_SGML)		\
	$(maintainerdoccleanfiles)	\
	$(NULL)
CLEANFILES =			\
	$(cleandocfiles)	\
Akira TAGOH's avatar
Akira TAGOH committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	$(LOCAL_SGML_FILES)	\
	confdir.sgml		\
	func.refs		\
	$(NULL)
BUILT_SOURCES =			\
	$(NULL)
SUFFIXES =	\
	.fncs	\
	.sgml	\
	.txt	\
	.html	\
	$(NULL)
TESTS =				\
	check-missing-doc	\
	$(NULL)
73
74
75
76
TESTS_ENVIRONMENT = \
	top_srcdir=${top_srcdir}; export top_srcdir; \
	$(NULL)
LOG_COMPILER = sh
Akira TAGOH's avatar
Akira TAGOH committed
77
#
Keith Packard's avatar
Keith Packard committed
78
DOC2HTML = docbook2html
Akira TAGOH's avatar
Akira TAGOH committed
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
DOC2TXT  = docbook2txt
DOC2MAN  = docbook2man
DOC2PDF  = docbook2pdf

DOC_FUNCS_FNCS =		\
	fcatomic.fncs		\
	fcblanks.fncs		\
	fccache.fncs		\
	fccharset.fncs		\
	fcconfig.fncs		\
	fcconstant.fncs		\
	fcdircache.fncs		\
	fcfile.fncs		\
	fcfontset.fncs		\
	fcformat.fncs		\
	fcfreetype.fncs		\
	fcinit.fncs		\
	fclangset.fncs		\
	fcmatrix.fncs		\
	fcobjectset.fncs	\
	fcobjecttype.fncs	\
	fcpattern.fncs		\
Akira TAGOH's avatar
Akira TAGOH committed
101
	fcrange.fncs		\
Akira TAGOH's avatar
Akira TAGOH committed
102
103
104
	fcstring.fncs		\
	fcstrset.fncs		\
	fcvalue.fncs		\
105
	fcweight.fncs		\
Akira TAGOH's avatar
Akira TAGOH committed
106
	$(NULL)
107
108
109
SGML_FILES =			\
	fontconfig-user.sgml	\
	fontconfig-devel.sgml	\
Akira TAGOH's avatar
Akira TAGOH committed
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	$(NULL)
LOCAL_SGML_FILES =			\
	local-fontconfig-user.sgml	\
	local-fontconfig-devel.sgml	\
	$(NULL)

DOC_FUNCS_SGML = $(DOC_FUNCS_FNCS:.fncs=.sgml)
BUILT_DOCS =		\
	$(HTML_FILES)	\
	$(PDF_FILES)	\
	$(TXT_FILES)	\
	$(man3_MANS)	\
	$(man5_MANS)	\
	$(NULL)
DOCS_DEPS =			\
	$(DOC_FUNCS_SGML)	\
	confdir.sgml		\
	version.sgml		\
	$(NULL)

TXT_FILES = $(SGML_FILES:.sgml=.txt)
PDF_FILES = $(SGML_FILES:.sgml=.pdf)
HTML_FILES =			\
	fontconfig-user.html	\
	$(NULL)
135
HTML_DIR = fontconfig-devel
Akira TAGOH's avatar
Akira TAGOH committed
136
137
138
#
noinst_PROGRAMS =	\
	$(NULL)
139
140
noinst_SCRIPTS =		\
	edit-sgml.py		\
Akira TAGOH's avatar
Akira TAGOH committed
141
	$(NULL)
142
##
Akira TAGOH's avatar
Akira TAGOH committed
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
check_SCRIPTS =			\
	check-missing-doc	\
	$(NULL)
#
man3_MANS =		\
	$(DOCMAN3)	\
	$(NULL)
man5_MANS =		\
	fonts-conf.5	\
	$(NULL)
#
doc_DATA =		\
	$(TXT_FILES)	\
	$(PDF_FILES)	\
	$(HTML_FILES)	\
	$(NULL)
#
htmldocdir = $(docdir)/$(HTML_DIR)
htmldoc_DATA =		\
	$(NULL)
163

164
if USEDOCBOOK
Akira TAGOH's avatar
Akira TAGOH committed
165
166
167
168
169
170
BUILT_SOURCES +=		\
	$(LOCAL_SGML_FILES)	\
	$(NULL)
htmldoc_DATA += $(HTML_DIR)/*

##
171
.fncs.sgml:
172
	$(AM_V_GEN) $(RM) $@; \
173
	$(PYTHON) $(srcdir)/edit-sgml.py $(srcdir)/func.sgml '$(srcdir)/$*.fncs' $*.sgml
174
.sgml.txt:
175
176
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2TXT) $*.sgml
177
.sgml.pdf:
178
179
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2PDF) $*.sgml
180
.sgml.html:
181
182
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2HTML) -u $*.sgml > $@
Akira TAGOH's avatar
Akira TAGOH committed
183
##
184
fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
185
186
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2MAN) local-fontconfig-user.sgml && \
187
	$(RM) manpage.*
Akira TAGOH's avatar
Akira TAGOH committed
188
189
190
##
$(man3_MANS): func.refs
func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
191
192
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
Akira TAGOH's avatar
Akira TAGOH committed
193
194
	mv devel-man/manpage.refs func.refs &&	\
	mv devel-man/*.3 . &&			\
195
	$(RM) devel-man/manpage.* &&		\
Akira TAGOH's avatar
Akira TAGOH committed
196
	rmdir devel-man || rm $@ || :
Akira TAGOH's avatar
Akira TAGOH committed
197
confdir.sgml: $(srcdir)/confdir.sgml.in
198
	$(AM_V_GEN) sed -e 's,@BASECONFIGDIR\@,${BASECONFIGDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
Akira TAGOH's avatar
Akira TAGOH committed
199
##
200
$(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) $(srcdir)/edit-sgml.py $(srcdir)/func.sgml
201
202
203
$(TXT_FILES): $(DOCS_DEPS)
$(PDF_FILES): $(DOCS_DEPS)
$(HTML_FILES): $(DOCS_DEPS)
204
$(HTML_DIR)/*: $(HTML_DIR)
Akira TAGOH's avatar
Akira TAGOH committed
205
$(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
206
207
	$(AM_V_GEN) $(RM) -r $@; \
	$(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
Akira TAGOH's avatar
Akira TAGOH committed
208
local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
209
	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;	\
Akira TAGOH's avatar
Akira TAGOH committed
210
	[ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
Akira TAGOH's avatar
Akira TAGOH committed
211
local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
212
	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@;	\
Akira TAGOH's avatar
Akira TAGOH committed
213
	[ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
Akira TAGOH's avatar
Akira TAGOH committed
214
215
216
#
all-local: $(BUILT_DOCS) $(HTML_DIR)/*
clean-local:
217
	$(RM) -r $(HTML_DIR) devel-man
Akira TAGOH's avatar
Akira TAGOH committed
218
	[ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
Behdad Esfahbod's avatar
Behdad Esfahbod committed
219
220
dist-local-check-docs-enabled:
	@true
221
else
Akira TAGOH's avatar
Akira TAGOH committed
222
htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
223
224
all-local:
clean-local:
Behdad Esfahbod's avatar
Behdad Esfahbod committed
225
226
227
dist-local-check-docs-enabled:
	@echo "*** --enable-man must be used in order to make dist"
	@false
228
endif
Behdad Esfahbod's avatar
Behdad Esfahbod committed
229

230
# force doc rebuild after configure
Behdad Esfahbod's avatar
Behdad Esfahbod committed
231
232
dist-hook-local: dist-local-check-docs-enabled

Behdad Esfahbod's avatar
Behdad Esfahbod committed
233
-include $(top_srcdir)/git.mk