]> git.wh0rd.org - fontconfig.git/blob - doc/Makefile.am
Make most generated-files cross-compiling-safe
[fontconfig.git] / doc / Makefile.am
1 #
2 # fontconfig/doc/Makefile.am
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 the author(s) not be used in
11 # advertising or publicity pertaining to distribution of the software without
12 # specific, written prior permission. The authors make 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 # THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 # EVENT SHALL THE AUTHOR(S) 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 DOC_SRC = $(srcdir)
25 DOC_MODULE = fontconfig
26 DOC2HTML = docbook2html
27 DOC2TXT = docbook2txt
28 DOC2MAN = docbook2man
29 DOC2PDF = docbook2pdf
30
31 TXT = fontconfig-user.txt fontconfig-devel.txt
32 PDF = fontconfig-user.pdf fontconfig-devel.pdf
33 HTML_FILES = fontconfig-user.html
34 HTML_DIR = fontconfig-devel
35 SGML = fontconfig-user.sgml fontconfig-devel.sgml
36 FNCS_TMPL = ${DOC_SRC}/func.sgml
37
38 DOC_FUNCS_FNCS=\
39 fcatomic.fncs \
40 fcblanks.fncs \
41 fccache.fncs \
42 fccharset.fncs \
43 fcconfig.fncs \
44 fcconstant.fncs \
45 fcdircache.fncs \
46 fcfile.fncs \
47 fcfontset.fncs \
48 fcformat.fncs \
49 fcfreetype.fncs \
50 fcinit.fncs \
51 fclangset.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 fccache.sgml \
64 fccharset.sgml \
65 fcconfig.sgml \
66 fcconstant.sgml \
67 fcdircache.sgml \
68 fcfile.sgml \
69 fcfontset.sgml \
70 fcformat.sgml \
71 fcfreetype.sgml \
72 fcinit.sgml \
73 fclangset.sgml \
74 fcmatrix.sgml \
75 fcobjectset.sgml \
76 fcobjecttype.sgml \
77 fcpattern.sgml \
78 fcstring.sgml \
79 fcstrset.sgml \
80 fcvalue.sgml
81
82 man5_MANS=fonts-conf.5
83 man3_MANS=$(DOCMAN3)
84
85 noinst_PROGRAMS=edit-sgml
86 edit_sgml_SOURCES=edit-sgml.c
87
88 DOC_FILES=$(TXT) $(PDF) $(HTML_FILES)
89 LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/*
90
91 check_SCRIPTS=check-missing-doc
92 TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh
93 TESTS=check-missing-doc
94
95 EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(DOC_FUNCS_SGML) $(check_SCRIPTS) func.sgml confdir.sgml.in
96
97 SUFFIXES=.fncs .sgml .txt .html
98
99 if USEDOCBOOK
100
101 if CROSS_COMPILING
102 .fncs.sgml:
103 @echo Warning: cannot rebuild $@ when cross-compiling
104 else
105 .fncs.sgml:
106 $(RM) $@
107 ./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
108 endif
109
110 .sgml.txt:
111 $(RM) $@
112 $(DOC2TXT) $<
113
114 .sgml.pdf:
115 $(RM) $@
116 $(DOC2PDF) $<
117
118 $(man3_MANS): func.refs
119
120 func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
121 $(RM) func.refs
122 $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
123 mv devel-man/manpage.refs func.refs && \
124 mv devel-man/*.3 . && \
125 $(RM) devel-man/manpage.* && \
126 rmdir devel-man
127
128 local-fontconfig-devel.sgml: fontconfig-devel.sgml
129 $(LN_S) $< $@
130
131 $(DOC_FUNCS_SGML): edit-sgml.c $(FNCS_TMPL)
132
133 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
134 $(RM) $@
135 $(DOC2MAN) local-fontconfig-user.sgml && \
136 $(RM) manpage.*
137
138 local-fontconfig-user.sgml: fontconfig-user.sgml
139 $(LN_S) $< $@
140
141 all-local: $(LOCAL_DOCS)
142
143 clean-local:
144 $(RM) $(man3_MANS) $(man5_MANS) $(DOC_FILES) func.refs
145 $(RM) -r $(HTML_DIR)
146
147 MAINTAINERCLEANFILES = $(DOC_FUNCS_SGML)
148
149 $(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
150 $(RM) -r $(HTML_DIR)
151 $(DOC2HTML) -V '%use-id-as-filename%' -o $(HTML_DIR) local-fontconfig-devel.sgml
152
153 fontconfig-devel.txt: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
154 $(RM) $@
155 $(DOC2TXT) local-fontconfig-devel.sgml
156 mv local-fontconfig-devel.txt $@
157
158 fontconfig-devel.pdf: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
159 $(RM) $@
160 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
161 || echo Failed to generate $@ >&2; \
162 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
163
164 fontconfig-user.html: local-fontconfig-user.sgml version.sgml confdir.sgml
165 $(RM) $@ local-$@ $@.tmp
166 $(DOC2HTML) -u local-fontconfig-user.sgml > $@.tmp
167 -test -f local-$@ && mv local-$@ $@
168 -test -f $@ || mv $@.tmp $@
169 -test -f $@.tmp && $(RM) $@.tmp
170
171 fontconfig-user.txt: local-fontconfig-user.sgml version.sgml confdir.sgml
172 $(RM) $@
173 $(DOC2TXT) local-fontconfig-user.sgml
174 mv local-fontconfig-user.txt $@
175
176 fontconfig-user.pdf: local-fontconfig-user.sgml version.sgml confdir.sgml
177 $(RM) $@
178 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
179 || echo Failed to generate $@ >&2; \
180 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
181
182 STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
183 confdir.sgml: ${DOC_SRC}/confdir.sgml.in
184 sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
185
186 CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
187
188 htmldoc_DATA = $(HTML_DIR)/*
189
190 $(HTML_DIR)/*: $(HTML_DIR)
191
192 else
193
194 htmldoc_DATA = $(srcdir)/$(HTML_DIR)/*
195
196 all-local:
197 clean-local:
198 endif
199
200 htmldocdir=$(docdir)/$(HTML_DIR)
201
202 doc_DATA = $(DOC_FILES)
203