fc-cache: --sysroot option takes an argument
[platform/upstream/fontconfig.git] / doc / Makefile.am
1 # -*- encoding: utf-8 -*-
2 #
3 # fontconfig/doc/Makefile.am
4 #
5 # Copyright © 2003 Keith Packard
6 #
7 # Permission to use, copy, modify, distribute, and sell this software and its
8 # documentation for any purpose is hereby granted without fee, provided that
9 # the above copyright notice appear in all copies and that both that
10 # copyright notice and this permission notice appear in supporting
11 # documentation, and that the name of the author(s) not be used in
12 # advertising or publicity pertaining to distribution of the software without
13 # specific, written prior permission.  The authors make no
14 # representations about the suitability of this software for any purpose.  It
15 # is provided "as is" without express or implied warranty.
16 #
17 # THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19 # EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23 # PERFORMANCE OF THIS SOFTWARE.
24
25 NULL =
26 EXTRA_DIST =                    \
27         $(BUILT_DOCS)           \
28         $(DOC_FUNCS_FNCS)       \
29         $(DOC_FUNCS_SGML)       \
30         $(HTML_DIR)/*           \
31         $(SGML_FILES)           \
32         $(check_SCRIPTS)        \
33         confdir.sgml.in         \
34         func.sgml               \
35         $(NULL)
36 MAINTAINERCLEANFILES =          \
37         $(DOC_FUNCS_SGML)       \
38         $(NULL)
39 CLEANFILES =                    \
40         $(BUILT_DOCS)           \
41         $(LOCAL_SGML_FILES)     \
42         confdir.sgml            \
43         func.refs               \
44         $(NULL)
45 BUILT_SOURCES =                 \
46         $(NULL)
47 SUFFIXES =      \
48         .fncs   \
49         .sgml   \
50         .txt    \
51         .html   \
52         $(NULL)
53 TESTS =                         \
54         check-missing-doc       \
55         $(NULL)
56 TESTS_ENVIRONMENT = \
57         top_srcdir=${top_srcdir}; export top_srcdir; \
58         $(NULL)
59 LOG_COMPILER = sh
60 #
61 DOC2HTML = docbook2html
62 DOC2TXT  = docbook2txt
63 DOC2MAN  = docbook2man
64 DOC2PDF  = docbook2pdf
65
66 DOC_FUNCS_FNCS =                \
67         fcatomic.fncs           \
68         fcblanks.fncs           \
69         fccache.fncs            \
70         fccharset.fncs          \
71         fcconfig.fncs           \
72         fcconstant.fncs         \
73         fcdircache.fncs         \
74         fcfile.fncs             \
75         fcfontset.fncs          \
76         fcformat.fncs           \
77         fcfreetype.fncs         \
78         fcinit.fncs             \
79         fclangset.fncs          \
80         fcmatrix.fncs           \
81         fcobjectset.fncs        \
82         fcobjecttype.fncs       \
83         fcpattern.fncs          \
84         fcstring.fncs           \
85         fcstrset.fncs           \
86         fcvalue.fncs            \
87         $(NULL)
88 SGML_FILES =                    \
89         fontconfig-user.sgml    \
90         fontconfig-devel.sgml   \
91         $(NULL)
92 LOCAL_SGML_FILES =                      \
93         local-fontconfig-user.sgml      \
94         local-fontconfig-devel.sgml     \
95         $(NULL)
96
97 DOC_FUNCS_SGML = $(DOC_FUNCS_FNCS:.fncs=.sgml)
98 BUILT_DOCS =            \
99         $(HTML_FILES)   \
100         $(PDF_FILES)    \
101         $(TXT_FILES)    \
102         $(man3_MANS)    \
103         $(man5_MANS)    \
104         $(NULL)
105 DOCS_DEPS =                     \
106         $(DOC_FUNCS_SGML)       \
107         confdir.sgml            \
108         version.sgml            \
109         $(NULL)
110
111 TXT_FILES = $(SGML_FILES:.sgml=.txt)
112 PDF_FILES = $(SGML_FILES:.sgml=.pdf)
113 HTML_FILES =                    \
114         fontconfig-user.html    \
115         $(NULL)
116 HTML_DIR = fontconfig-devel
117 #
118 noinst_PROGRAMS =       \
119         $(NULL)
120 ##
121 edit_sgml_SOURCES =     \
122         edit-sgml.c     \
123         $(NULL)
124 edit_sgml_CC = $(CC_FOR_BUILD)
125 #
126 check_SCRIPTS =                 \
127         check-missing-doc       \
128         $(NULL)
129 #
130 man3_MANS =             \
131         $(DOCMAN3)      \
132         $(NULL)
133 man5_MANS =             \
134         fonts-conf.5    \
135         $(NULL)
136 #
137 doc_DATA =              \
138         $(TXT_FILES)    \
139         $(PDF_FILES)    \
140         $(HTML_FILES)   \
141         $(NULL)
142 #
143 htmldocdir = $(docdir)/$(HTML_DIR)
144 htmldoc_DATA =          \
145         $(NULL)
146
147 if USEDOCBOOK
148 BUILT_SOURCES +=                \
149         $(LOCAL_SGML_FILES)     \
150         $(NULL)
151 noinst_PROGRAMS +=      \
152         edit-sgml       \
153         $(NULL)
154 htmldoc_DATA += $(HTML_DIR)/*
155
156 ##
157 .fncs.sgml:
158         $(AM_V_GEN) $(RM) $@; \
159         $(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$(srcdir)/$*.fncs' > $*.sgml
160 .sgml.txt:
161         $(AM_V_GEN) $(RM) $@; \
162         $(DOC2TXT) $*.sgml
163 .sgml.pdf:
164         $(AM_V_GEN) $(RM) $@; \
165         $(DOC2PDF) $*.sgml
166 .sgml.html:
167         $(AM_V_GEN) $(RM) $@; \
168         $(DOC2HTML) -u $*.sgml > $@
169 ##
170 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
171         $(AM_V_GEN) $(RM) $@; \
172         $(DOC2MAN) local-fontconfig-user.sgml && \
173         $(RM) manpage.*
174 ##
175 $(man3_MANS): func.refs
176 func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
177         $(AM_V_GEN) $(RM) $@; \
178         $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
179         mv devel-man/manpage.refs func.refs &&  \
180         mv devel-man/*.3 . &&                   \
181         $(RM) devel-man/manpage.* &&            \
182         rmdir devel-man || rm $@ || :
183 confdir.sgml: $(srcdir)/confdir.sgml.in
184         $(AM_V_GEN) sed -e 's,@CONFDIR\@,${CONFDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
185 ##
186 $(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) edit-sgml$(EXEEXT) $(srcdir)/func.sgml
187 $(TXT_FILES): $(DOCS_DEPS)
188 $(PDF_FILES): $(DOCS_DEPS)
189 $(HTML_FILES): $(DOCS_DEPS)
190 $(HTML_DIR)/*: $(HTML_DIR)
191 $(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
192         $(AM_V_GEN) $(RM) -r $@; \
193         $(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
194 local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
195         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;  \
196         [ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
197 local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
198         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@; \
199         [ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
200 #
201 all-local: $(BUILT_DOCS) $(HTML_DIR)/*
202 clean-local:
203         $(RM) -r $(HTML_DIR) devel-man
204         [ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
205 dist-local-check-docs-enabled:
206         @true
207 else
208 htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
209 all-local:
210 clean-local:
211 dist-local-check-docs-enabled:
212         @echo "*** --enable-man must be used in order to make dist"
213         @false
214 endif
215
216 # force doc rebulid after configure
217 dist-hook-local: dist-local-check-docs-enabled
218
219 -include $(top_srcdir)/git.mk