Imported Upstream version 2.11.93
[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         fcrange.fncs            \
85         fcstring.fncs           \
86         fcstrset.fncs           \
87         fcvalue.fncs            \
88         fcweight.fncs           \
89         $(NULL)
90 SGML_FILES =                    \
91         fontconfig-user.sgml    \
92         fontconfig-devel.sgml   \
93         $(NULL)
94 LOCAL_SGML_FILES =                      \
95         local-fontconfig-user.sgml      \
96         local-fontconfig-devel.sgml     \
97         $(NULL)
98
99 DOC_FUNCS_SGML = $(DOC_FUNCS_FNCS:.fncs=.sgml)
100 BUILT_DOCS =            \
101         $(HTML_FILES)   \
102         $(PDF_FILES)    \
103         $(TXT_FILES)    \
104         $(man3_MANS)    \
105         $(man5_MANS)    \
106         $(NULL)
107 DOCS_DEPS =                     \
108         $(DOC_FUNCS_SGML)       \
109         confdir.sgml            \
110         version.sgml            \
111         $(NULL)
112
113 TXT_FILES = $(SGML_FILES:.sgml=.txt)
114 PDF_FILES = $(SGML_FILES:.sgml=.pdf)
115 HTML_FILES =                    \
116         fontconfig-user.html    \
117         $(NULL)
118 HTML_DIR = fontconfig-devel
119 #
120 noinst_PROGRAMS =       \
121         $(NULL)
122 ##
123 edit_sgml_SOURCES =     \
124         edit-sgml.c     \
125         $(NULL)
126 edit_sgml_CC = $(CC_FOR_BUILD)
127 #
128 check_SCRIPTS =                 \
129         check-missing-doc       \
130         $(NULL)
131 #
132 man3_MANS =             \
133         $(DOCMAN3)      \
134         $(NULL)
135 man5_MANS =             \
136         fonts-conf.5    \
137         $(NULL)
138 #
139 doc_DATA =              \
140         $(TXT_FILES)    \
141         $(PDF_FILES)    \
142         $(HTML_FILES)   \
143         $(NULL)
144 #
145 htmldocdir = $(docdir)/$(HTML_DIR)
146 htmldoc_DATA =          \
147         $(NULL)
148
149 if USEDOCBOOK
150 BUILT_SOURCES +=                \
151         $(LOCAL_SGML_FILES)     \
152         $(NULL)
153 noinst_PROGRAMS +=      \
154         edit-sgml       \
155         $(NULL)
156 htmldoc_DATA += $(HTML_DIR)/*
157
158 ##
159 .fncs.sgml:
160         $(AM_V_GEN) $(RM) $@; \
161         $(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$(srcdir)/$*.fncs' > $*.sgml
162 .sgml.txt:
163         $(AM_V_GEN) $(RM) $@; \
164         $(DOC2TXT) $*.sgml
165 .sgml.pdf:
166         $(AM_V_GEN) $(RM) $@; \
167         $(DOC2PDF) $*.sgml
168 .sgml.html:
169         $(AM_V_GEN) $(RM) $@; \
170         $(DOC2HTML) -u $*.sgml > $@
171 ##
172 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
173         $(AM_V_GEN) $(RM) $@; \
174         $(DOC2MAN) local-fontconfig-user.sgml && \
175         $(RM) manpage.*
176 ##
177 $(man3_MANS): func.refs
178 func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
179         $(AM_V_GEN) $(RM) $@; \
180         $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
181         mv devel-man/manpage.refs func.refs &&  \
182         mv devel-man/*.3 . &&                   \
183         $(RM) devel-man/manpage.* &&            \
184         rmdir devel-man || rm $@ || :
185 confdir.sgml: $(srcdir)/confdir.sgml.in
186         $(AM_V_GEN) sed -e 's,@CONFDIR\@,${CONFDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
187 ##
188 $(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) edit-sgml$(EXEEXT) $(srcdir)/func.sgml
189 $(TXT_FILES): $(DOCS_DEPS)
190 $(PDF_FILES): $(DOCS_DEPS)
191 $(HTML_FILES): $(DOCS_DEPS)
192 $(HTML_DIR)/*: $(HTML_DIR)
193 $(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
194         $(AM_V_GEN) $(RM) -r $@; \
195         $(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
196 local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
197         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;  \
198         [ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
199 local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
200         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@; \
201         [ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
202 #
203 all-local: $(BUILT_DOCS) $(HTML_DIR)/*
204 clean-local:
205         $(RM) -r $(HTML_DIR) devel-man
206         [ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
207 dist-local-check-docs-enabled:
208         @true
209 else
210 htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
211 all-local:
212 clean-local:
213 dist-local-check-docs-enabled:
214         @echo "*** --enable-man must be used in order to make dist"
215         @false
216 endif
217
218 # force doc rebulid after configure
219 dist-hook-local: dist-local-check-docs-enabled
220
221 -include $(top_srcdir)/git.mk