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