Makefile.am 5.19 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
NULL =
EXTRA_DIST =			\
	$(BUILT_DOCS)		\
	$(DOC_FUNCS_FNCS)	\
	$(DOC_FUNCS_SGML)	\
	$(HTML_DIR)/*		\
	$(SGML_FILES)		\
	$(check_SCRIPTS)	\
	confdir.sgml.in		\
	func.sgml		\
	$(NULL)
MAINTAINERCLEANFILES =		\
	$(DOC_FUNCS_SGML)	\
	$(NULL)
CLEANFILES =			\
	$(BUILT_DOCS)		\
	$(LOCAL_SGML_FILES)	\
	confdir.sgml		\
	func.refs		\
	$(NULL)
BUILT_SOURCES =			\
	$(NULL)
SUFFIXES =	\
	.fncs	\
	.sgml	\
	.txt	\
	.html	\
	$(NULL)
TESTS =				\
	check-missing-doc	\
	$(NULL)
TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh
#
Keith Packard's avatar
Keith Packard committed
58
DOC2HTML = docbook2html
Akira TAGOH's avatar
Akira TAGOH committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
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		\
	fcstring.fncs		\
	fcstrset.fncs		\
	fcvalue.fncs		\
	$(NULL)
85 86 87
SGML_FILES =			\
	fontconfig-user.sgml	\
	fontconfig-devel.sgml	\
Akira TAGOH's avatar
Akira TAGOH committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
	$(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)
113
HTML_DIR = fontconfig-devel
Akira TAGOH's avatar
Akira TAGOH committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
#
noinst_PROGRAMS =	\
	$(NULL)
##
edit_sgml_SOURCES =	\
	edit-sgml.c	\
	$(NULL)
#
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)
142

143
if USEDOCBOOK
Akira TAGOH's avatar
Akira TAGOH committed
144 145 146 147 148 149 150 151 152
BUILT_SOURCES +=		\
	$(LOCAL_SGML_FILES)	\
	$(NULL)
noinst_PROGRAMS +=	\
	edit-sgml	\
	$(NULL)
htmldoc_DATA += $(HTML_DIR)/*

##
153 154 155 156
if CROSS_COMPILING
.fncs.sgml:
	@echo Warning: cannot rebuild $@ when cross-compiling
else
157
.fncs.sgml:
158
	$(AM_V_GEN) $(RM) $@; \
159
	$(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$(srcdir)/$*.fncs' > $*.sgml
160
endif
161
.sgml.txt:
162 163
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2TXT) $*.sgml
164
.sgml.pdf:
165 166
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2PDF) $*.sgml
167
.sgml.html:
168 169
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2HTML) -u $*.sgml > $@
Akira TAGOH's avatar
Akira TAGOH committed
170
##
171
fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
172 173
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2MAN) local-fontconfig-user.sgml && \
174
	$(RM) manpage.*
Akira TAGOH's avatar
Akira TAGOH committed
175 176 177
##
$(man3_MANS): func.refs
func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
178 179
	$(AM_V_GEN) $(RM) $@; \
	$(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
Akira TAGOH's avatar
Akira TAGOH committed
180 181
	mv devel-man/manpage.refs func.refs &&	\
	mv devel-man/*.3 . &&			\
182
	$(RM) devel-man/manpage.* &&		\
183
	rmdir devel-man || rm $@ || :
Akira TAGOH's avatar
Akira TAGOH committed
184
confdir.sgml: $(srcdir)/confdir.sgml.in
185
	$(AM_V_GEN) sed -e 's,@CONFDIR\@,${CONFDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
Akira TAGOH's avatar
Akira TAGOH committed
186
##
187 188 189 190
$(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) edit-sgml$(EXEEXT) $(srcdir)/func.sgml
$(TXT_FILES): $(DOCS_DEPS)
$(PDF_FILES): $(DOCS_DEPS)
$(HTML_FILES): $(DOCS_DEPS)
191
$(HTML_DIR)/*: $(HTML_DIR)
Akira TAGOH's avatar
Akira TAGOH committed
192
$(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
193 194
	$(AM_V_GEN) $(RM) -r $@; \
	$(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
Akira TAGOH's avatar
Akira TAGOH committed
195
local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
196
	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;	\
Akira TAGOH's avatar
Akira TAGOH committed
197
	[ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
Akira TAGOH's avatar
Akira TAGOH committed
198
local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
199
	$(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@;	\
Akira TAGOH's avatar
Akira TAGOH committed
200
	[ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
Akira TAGOH's avatar
Akira TAGOH committed
201 202 203
#
all-local: $(BUILT_DOCS) $(HTML_DIR)/*
clean-local:
204
	$(RM) -r $(HTML_DIR) devel-man
205
	[ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
206
else
Akira TAGOH's avatar
Akira TAGOH committed
207
htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
208 209 210
all-local:
clean-local:
endif