]> git.wh0rd.org - fontconfig.git/blame - doc/Makefile.am
Make most generated-files cross-compiling-safe
[fontconfig.git] / doc / Makefile.am
CommitLineData
394b2bf0 1#
e690fbb2 2# fontconfig/doc/Makefile.am
394b2bf0
KP
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
5aaf466d 10# documentation, and that the name of the author(s) not be used in
394b2bf0 11# advertising or publicity pertaining to distribution of the software without
5aaf466d 12# specific, written prior permission. The authors make no
394b2bf0
KP
13# representations about the suitability of this software for any purpose. It
14# is provided "as is" without express or implied warranty.
15#
3074a73b 16# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
394b2bf0 17# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
3074a73b 18# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
394b2bf0
KP
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
4cbc3ee8 24DOC_SRC = $(srcdir)
b219ac6b
KP
25DOC_MODULE = fontconfig
26DOC2HTML = docbook2html
27DOC2TXT = docbook2txt
28DOC2MAN = docbook2man
0c009d2b 29DOC2PDF = docbook2pdf
0da305f7 30
b219ac6b 31TXT = fontconfig-user.txt fontconfig-devel.txt
0c009d2b 32PDF = fontconfig-user.pdf fontconfig-devel.pdf
b219ac6b 33HTML_FILES = fontconfig-user.html
4cbc3ee8
KP
34HTML_DIR = fontconfig-devel
35SGML = fontconfig-user.sgml fontconfig-devel.sgml
394b2bf0 36FNCS_TMPL = ${DOC_SRC}/func.sgml
0da305f7 37
22671e25 38DOC_FUNCS_FNCS=\
b219ac6b
KP
39 fcatomic.fncs \
40 fcblanks.fncs \
a190678e 41 fccache.fncs \
22671e25 42 fccharset.fncs \
b219ac6b
KP
43 fcconfig.fncs \
44 fcconstant.fncs \
a190678e 45 fcdircache.fncs \
b219ac6b 46 fcfile.fncs \
bfc2dc3a 47 fcfontset.fncs \
caeea376 48 fcformat.fncs \
b219ac6b
KP
49 fcfreetype.fncs \
50 fcinit.fncs \
a190678e 51 fclangset.fncs \
b219ac6b 52 fcmatrix.fncs \
bfc2dc3a
KP
53 fcobjectset.fncs \
54 fcobjecttype.fncs \
b219ac6b
KP
55 fcpattern.fncs \
56 fcstring.fncs \
39381776 57 fcstrset.fncs \
b219ac6b 58 fcvalue.fncs
34cd0514 59
22671e25 60DOC_FUNCS_SGML=\
b219ac6b
KP
61 fcatomic.sgml \
62 fcblanks.sgml \
9bfb41ff 63 fccache.sgml \
22671e25 64 fccharset.sgml \
b219ac6b
KP
65 fcconfig.sgml \
66 fcconstant.sgml \
9bfb41ff 67 fcdircache.sgml \
b219ac6b 68 fcfile.sgml \
bfc2dc3a 69 fcfontset.sgml \
caeea376 70 fcformat.sgml \
b219ac6b
KP
71 fcfreetype.sgml \
72 fcinit.sgml \
9bfb41ff 73 fclangset.sgml \
b219ac6b 74 fcmatrix.sgml \
bfc2dc3a
KP
75 fcobjectset.sgml \
76 fcobjecttype.sgml \
b219ac6b
KP
77 fcpattern.sgml \
78 fcstring.sgml \
39381776 79 fcstrset.sgml \
b219ac6b
KP
80 fcvalue.sgml
81
2a6b235f 82man5_MANS=fonts-conf.5
dc2e06ab 83man3_MANS=$(DOCMAN3)
22671e25
KP
84
85noinst_PROGRAMS=edit-sgml
86edit_sgml_SOURCES=edit-sgml.c
87
0c009d2b 88DOC_FILES=$(TXT) $(PDF) $(HTML_FILES)
dc2e06ab 89LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/*
bdc0fd54 90
9a54f8a1
KP
91check_SCRIPTS=check-missing-doc
92TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh
93TESTS=check-missing-doc
94
2a6b235f 95EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(DOC_FUNCS_SGML) $(check_SCRIPTS) func.sgml confdir.sgml.in
34cd0514 96
22671e25 97SUFFIXES=.fncs .sgml .txt .html
0da305f7 98
2b45ef3a 99if USEDOCBOOK
bdc0fd54 100
2a6b235f
BE
101if CROSS_COMPILING
102.fncs.sgml:
103 @echo Warning: cannot rebuild $@ when cross-compiling
104else
22671e25 105.fncs.sgml:
0da305f7 106 $(RM) $@
d8ae9c92 107 ./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
2a6b235f 108endif
0da305f7
KP
109
110.sgml.txt:
111 $(RM) $@
394b2bf0 112 $(DOC2TXT) $<
0da305f7 113
0c009d2b
KP
114.sgml.pdf:
115 $(RM) $@
116 $(DOC2PDF) $<
117
dc2e06ab 118$(man3_MANS): func.refs
9238fc06 119
4cbc3ee8 120func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
b219ac6b 121 $(RM) func.refs
ed7955a5
KP
122 $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
123 mv devel-man/manpage.refs func.refs && \
124 mv devel-man/*.3 . && \
98d765a5 125 $(RM) devel-man/manpage.* && \
ed7955a5 126 rmdir devel-man
22671e25 127
4cbc3ee8
KP
128local-fontconfig-devel.sgml: fontconfig-devel.sgml
129 $(LN_S) $< $@
130
2a6b235f 131$(DOC_FUNCS_SGML): edit-sgml.c $(FNCS_TMPL)
22671e25 132
4cbc3ee8
KP
133fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
134 $(RM) $@
89d6119c 135 $(DOC2MAN) local-fontconfig-user.sgml && \
98d765a5 136 $(RM) manpage.*
4cbc3ee8
KP
137
138local-fontconfig-user.sgml: fontconfig-user.sgml
139 $(LN_S) $< $@
b219ac6b 140
4484582e 141all-local: $(LOCAL_DOCS)
22671e25 142
4484582e 143clean-local:
2a6b235f 144 $(RM) $(man3_MANS) $(man5_MANS) $(DOC_FILES) func.refs
4cbc3ee8 145 $(RM) -r $(HTML_DIR)
22671e25 146
2a6b235f
BE
147MAINTAINERCLEANFILES = $(DOC_FUNCS_SGML)
148
4cbc3ee8
KP
149$(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
150 $(RM) -r $(HTML_DIR)
6ca36812 151 $(DOC2HTML) -V '%use-id-as-filename%' -o $(HTML_DIR) local-fontconfig-devel.sgml
394b2bf0 152
dc2e06ab 153fontconfig-devel.txt: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
4cbc3ee8
KP
154 $(RM) $@
155 $(DOC2TXT) local-fontconfig-devel.sgml
156 mv local-fontconfig-devel.txt $@
394b2bf0 157
dc2e06ab 158fontconfig-devel.pdf: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
0c009d2b 159 $(RM) $@
2cae0512 160 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
af2ad236
PL
161 || echo Failed to generate $@ >&2; \
162 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
0c009d2b 163
4cbc3ee8
KP
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 $@
408dd9c0 169 -test -f $@.tmp && $(RM) $@.tmp
394b2bf0 170
4cbc3ee8
KP
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 $@
4b4f42ab 175
0c009d2b
KP
176fontconfig-user.pdf: local-fontconfig-user.sgml version.sgml confdir.sgml
177 $(RM) $@
2cae0512 178 $(top_srcdir)/missing --run $(DOC2PDF) $< && mv local-$@ $@ \
af2ad236
PL
179 || echo Failed to generate $@ >&2; \
180 (test -f $@ || echo $(DOC2PDF) is required to generate this file >> $@)
0c009d2b 181
f946755c 182STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
394b2bf0
KP
183confdir.sgml: ${DOC_SRC}/confdir.sgml.in
184 sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
185
4cbc3ee8 186CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
4b4f42ab 187
2cae0512
PB
188htmldoc_DATA = $(HTML_DIR)/*
189
190$(HTML_DIR)/*: $(HTML_DIR)
191
bdc0fd54 192else
2cae0512
PB
193
194htmldoc_DATA = $(srcdir)/$(HTML_DIR)/*
195
bdc0fd54
KP
196all-local:
197clean-local:
198endif
199
4cbc3ee8
KP
200htmldocdir=$(docdir)/$(HTML_DIR)
201
202doc_DATA = $(DOC_FILES)
203