4 # Copyright © 2003 Keith Packard
6 # Permission to use, copy, modify, distribute, and sell this software and its
7 # documentation for any purpose is hereby granted without fee, provided that
8 # the above copyright notice appear in all copies and that both that
9 # copyright notice and this permission notice appear in supporting
10 # documentation, and that the name of Keith Packard not be used in
11 # advertising or publicity pertaining to distribution of the software without
12 # specific, written prior permission. Keith Packard makes no
13 # representations about the suitability of this software for any purpose. It
14 # is provided "as is" without express or implied warranty.
16 # KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 # EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 # PERFORMANCE OF THIS SOFTWARE.
25 EXEEXT = @EXEEXT_FOR_BUILD@
26 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
29 DOC_MODULE = fontconfig
30 DOC2HTML = docbook2html
35 TXT = fontconfig-user.txt fontconfig-devel.txt
36 PDF = fontconfig-user.pdf fontconfig-devel.pdf
37 HTML_FILES = fontconfig-user.html
38 HTML_DIR = fontconfig-devel
39 SGML = fontconfig-user.sgml fontconfig-devel.sgml
40 FNCS_TMPL = ${DOC_SRC}/func.sgml
78 man5_MANS=fonts-conf.5
81 noinst_PROGRAMS=edit-sgml
82 edit_sgml_SOURCES=edit-sgml.c
86 DOC_FILES=$(TXT) $(PDF) $(HTML_FILES)
87 LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/*
89 EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) func.sgml confdir.sgml.in
91 SUFFIXES=.fncs .sgml .txt .html
97 ./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
107 $(man3_MANS): func.refs
109 func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
111 $(DOC2MAN) local-fontconfig-devel.sgml && \
112 mv manpage.refs func.refs
115 local-fontconfig-devel.sgml: fontconfig-devel.sgml
118 $(DOC_FUNCS_SGML): edit-sgml$(EXEEXT) $(FNCS_TMPL)
120 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
122 $(DOC2MAN) local-fontconfig-user.sgml && \
123 $(RM) manpage.refs manpage.links
125 local-fontconfig-user.sgml: fontconfig-user.sgml
128 all-local: $(LOCAL_DOCS)
131 $(RM) $(man3_MANS) $(man5_MANS) $(DOC_FILES) $(DOC_FUNCS_SGML) func.refs
134 $(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
136 $(DOC2HTML) -o $(HTML_DIR) local-fontconfig-devel.sgml
138 fontconfig-devel.txt: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
140 $(DOC2TXT) local-fontconfig-devel.sgml
141 mv local-fontconfig-devel.txt $@
143 fontconfig-devel.pdf: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
145 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
146 || echo Failed to generate $@ >&2; \
147 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
149 fontconfig-user.html: local-fontconfig-user.sgml version.sgml confdir.sgml
150 $(RM) $@ local-$@ $@.tmp
151 $(DOC2HTML) -u local-fontconfig-user.sgml > $@.tmp
152 -test -f local-$@ && mv local-$@ $@
153 -test -f $@ || mv $@.tmp $@
154 -test -f $@.tmp && $(RM) $@.tmp
156 fontconfig-user.txt: local-fontconfig-user.sgml version.sgml confdir.sgml
158 $(DOC2TXT) local-fontconfig-user.sgml
159 mv local-fontconfig-user.txt $@
161 fontconfig-user.pdf: local-fontconfig-user.sgml version.sgml confdir.sgml
163 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
164 || echo Failed to generate $@ >&2; \
165 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
167 STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
168 confdir.sgml: ${DOC_SRC}/confdir.sgml.in
169 sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
171 CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
173 htmldoc_DATA = $(HTML_DIR)/*
175 $(HTML_DIR)/*: $(HTML_DIR)
179 htmldoc_DATA = $(srcdir)/$(HTML_DIR)/*
185 htmldocdir=$(docdir)/$(HTML_DIR)
187 doc_DATA = $(DOC_FILES)