]> git.wh0rd.org - fontconfig.git/blame_incremental - doc/Makefile.am
Make most generated-files cross-compiling-safe
[fontconfig.git] / doc / Makefile.am
... / ...
CommitLineData
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
24DOC_SRC = $(srcdir)
25DOC_MODULE = fontconfig
26DOC2HTML = docbook2html
27DOC2TXT = docbook2txt
28DOC2MAN = docbook2man
29DOC2PDF = docbook2pdf
30
31TXT = fontconfig-user.txt fontconfig-devel.txt
32PDF = fontconfig-user.pdf fontconfig-devel.pdf
33HTML_FILES = fontconfig-user.html
34HTML_DIR = fontconfig-devel
35SGML = fontconfig-user.sgml fontconfig-devel.sgml
36FNCS_TMPL = ${DOC_SRC}/func.sgml
37
38DOC_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
60DOC_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
82man5_MANS=fonts-conf.5
83man3_MANS=$(DOCMAN3)
84
85noinst_PROGRAMS=edit-sgml
86edit_sgml_SOURCES=edit-sgml.c
87
88DOC_FILES=$(TXT) $(PDF) $(HTML_FILES)
89LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/*
90
91check_SCRIPTS=check-missing-doc
92TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh
93TESTS=check-missing-doc
94
95EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(DOC_FUNCS_SGML) $(check_SCRIPTS) func.sgml confdir.sgml.in
96
97SUFFIXES=.fncs .sgml .txt .html
98
99if USEDOCBOOK
100
101if CROSS_COMPILING
102.fncs.sgml:
103 @echo Warning: cannot rebuild $@ when cross-compiling
104else
105.fncs.sgml:
106 $(RM) $@
107 ./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
108endif
109
110.sgml.txt:
111 $(RM) $@
112 $(DOC2TXT) $<
113
114.sgml.pdf:
115 $(RM) $@
116 $(DOC2PDF) $<
117
118$(man3_MANS): func.refs
119
120func.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
128local-fontconfig-devel.sgml: fontconfig-devel.sgml
129 $(LN_S) $< $@
130
131$(DOC_FUNCS_SGML): edit-sgml.c $(FNCS_TMPL)
132
133fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
134 $(RM) $@
135 $(DOC2MAN) local-fontconfig-user.sgml && \
136 $(RM) manpage.*
137
138local-fontconfig-user.sgml: fontconfig-user.sgml
139 $(LN_S) $< $@
140
141all-local: $(LOCAL_DOCS)
142
143clean-local:
144 $(RM) $(man3_MANS) $(man5_MANS) $(DOC_FILES) func.refs
145 $(RM) -r $(HTML_DIR)
146
147MAINTAINERCLEANFILES = $(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
153fontconfig-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
158fontconfig-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
164fontconfig-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
171fontconfig-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
176fontconfig-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
182STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
183confdir.sgml: ${DOC_SRC}/confdir.sgml.in
184 sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
185
186CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
187
188htmldoc_DATA = $(HTML_DIR)/*
189
190$(HTML_DIR)/*: $(HTML_DIR)
191
192else
193
194htmldoc_DATA = $(srcdir)/$(HTML_DIR)/*
195
196all-local:
197clean-local:
198endif
199
200htmldocdir=$(docdir)/$(HTML_DIR)
201
202doc_DATA = $(DOC_FILES)
203