]> git.wh0rd.org - fontconfig.git/blob - doc/Makefile.am
e5c922b30568f6ba72ac953e215429e070aa5322
[fontconfig.git] / doc / Makefile.am
1 #
2 # $Id$
3 #
4 # Copyright © 2003 Keith Packard
5 #
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.
15 #
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.
23
24 CC = @CC_FOR_BUILD@
25 EXEEXT = @EXEEXT_FOR_BUILD@
26 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
27
28 DOC_SRC = $(srcdir)
29 DOC_MODULE = fontconfig
30 DOC2HTML = docbook2html
31 DOC2TXT = docbook2txt
32 DOC2MAN = docbook2man
33 DOC2PDF = docbook2pdf
34
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
41
42 DOC_FUNCS_FNCS=\
43 fcatomic.fncs \
44 fcblanks.fncs \
45 fccache.fncs \
46 fccharset.fncs \
47 fcconfig.fncs \
48 fcconstant.fncs \
49 fcdircache.fncs \
50 fcfile.fncs \
51 fcfontset.fncs \
52 fcfreetype.fncs \
53 fcinit.fncs \
54 fclangset.fncs \
55 fcmatrix.fncs \
56 fcobjectset.fncs \
57 fcobjecttype.fncs \
58 fcpattern.fncs \
59 fcstring.fncs \
60 fcstrset.fncs \
61 fcvalue.fncs
62
63 DOC_FUNCS_SGML=\
64 fcatomic.sgml \
65 fcblanks.sgml \
66 fccharset.sgml \
67 fcconfig.sgml \
68 fcconstant.sgml \
69 fcfile.sgml \
70 fcfontset.sgml \
71 fcfreetype.sgml \
72 fcinit.sgml \
73 fcmatrix.sgml \
74 fcobjectset.sgml \
75 fcobjecttype.sgml \
76 fcpattern.sgml \
77 fcstring.sgml \
78 fcstrset.sgml \
79 fcvalue.sgml
80
81 man5_MANS=fonts-conf.5
82 man3_MANS=$(DOCMAN3)
83
84 noinst_PROGRAMS=edit-sgml
85 edit_sgml_SOURCES=edit-sgml.c
86
87 docdir=@DOCDIR@
88
89 DOC_FILES=$(TXT) $(PDF) $(HTML_FILES)
90 LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/*
91
92 check_SCRIPTS=check-missing-doc
93 TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh
94 TESTS=check-missing-doc
95
96 EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(check_SCRIPTS) func.sgml confdir.sgml.in
97
98 SUFFIXES=.fncs .sgml .txt .html
99
100 if USEDOCBOOK
101
102 .fncs.sgml:
103 $(RM) $@
104 ./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
105
106 .sgml.txt:
107 $(RM) $@
108 $(DOC2TXT) $<
109
110 .sgml.pdf:
111 $(RM) $@
112 $(DOC2PDF) $<
113
114 $(man3_MANS): func.refs
115
116 func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
117 $(RM) func.refs
118 $(DOC2MAN) local-fontconfig-devel.sgml && \
119 mv manpage.refs func.refs
120 $(RM) manpage.links
121
122 local-fontconfig-devel.sgml: fontconfig-devel.sgml
123 $(LN_S) $< $@
124
125 $(DOC_FUNCS_SGML): edit-sgml$(EXEEXT) $(FNCS_TMPL)
126
127 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
128 $(RM) $@
129 $(DOC2MAN) local-fontconfig-user.sgml && \
130 $(RM) manpage.refs manpage.links
131
132 local-fontconfig-user.sgml: fontconfig-user.sgml
133 $(LN_S) $< $@
134
135 all-local: $(LOCAL_DOCS)
136
137 clean-local:
138 $(RM) $(man3_MANS) $(man5_MANS) $(DOC_FILES) $(DOC_FUNCS_SGML) func.refs
139 $(RM) -r $(HTML_DIR)
140
141 $(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
142 $(RM) -r $(HTML_DIR)
143 $(DOC2HTML) -o $(HTML_DIR) local-fontconfig-devel.sgml
144
145 fontconfig-devel.txt: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
146 $(RM) $@
147 $(DOC2TXT) local-fontconfig-devel.sgml
148 mv local-fontconfig-devel.txt $@
149
150 fontconfig-devel.pdf: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
151 $(RM) $@
152 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
153 || echo Failed to generate $@ >&2; \
154 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
155
156 fontconfig-user.html: local-fontconfig-user.sgml version.sgml confdir.sgml
157 $(RM) $@ local-$@ $@.tmp
158 $(DOC2HTML) -u local-fontconfig-user.sgml > $@.tmp
159 -test -f local-$@ && mv local-$@ $@
160 -test -f $@ || mv $@.tmp $@
161 -test -f $@.tmp && $(RM) $@.tmp
162
163 fontconfig-user.txt: local-fontconfig-user.sgml version.sgml confdir.sgml
164 $(RM) $@
165 $(DOC2TXT) local-fontconfig-user.sgml
166 mv local-fontconfig-user.txt $@
167
168 fontconfig-user.pdf: local-fontconfig-user.sgml version.sgml confdir.sgml
169 $(RM) $@
170 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
171 || echo Failed to generate $@ >&2; \
172 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
173
174 STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
175 confdir.sgml: ${DOC_SRC}/confdir.sgml.in
176 sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
177
178 CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
179
180 htmldoc_DATA = $(HTML_DIR)/*
181
182 $(HTML_DIR)/*: $(HTML_DIR)
183
184 else
185
186 htmldoc_DATA = $(srcdir)/$(HTML_DIR)/*
187
188 all-local:
189 clean-local:
190 endif
191
192 htmldocdir=$(docdir)/$(HTML_DIR)
193
194 doc_DATA = $(DOC_FILES)
195