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