2194ab7f12736486e7a2723410f7b7899c70a6f6
[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_OBJECTS) : CC:=$(CC_FOR_BUILD)
127 $(edit_sgml_OBJECTS) : CFLAGS:=$(CFLAGS_FOR_BUILD)
128 $(edit_sgml_OBJECTS) : CPPFLAGS:=$(CPPFLAGS_FOR_BUILD)
129 edit_sgml_LINK = $(CC_FOR_BUILD) -o $@
130 #
131 check_SCRIPTS =                 \
132         check-missing-doc       \
133         $(NULL)
134 #
135 man3_MANS =             \
136         $(DOCMAN3)      \
137         $(NULL)
138 man5_MANS =             \
139         fonts-conf.5    \
140         $(NULL)
141 #
142 doc_DATA =              \
143         $(TXT_FILES)    \
144         $(PDF_FILES)    \
145         $(HTML_FILES)   \
146         $(NULL)
147 #
148 htmldocdir = $(docdir)/$(HTML_DIR)
149 htmldoc_DATA =          \
150         $(NULL)
151
152 if USEDOCBOOK
153 BUILT_SOURCES +=                \
154         $(LOCAL_SGML_FILES)     \
155         $(NULL)
156 noinst_PROGRAMS +=      \
157         edit-sgml       \
158         $(NULL)
159 htmldoc_DATA += $(HTML_DIR)/*
160
161 ##
162 .fncs.sgml:
163         $(AM_V_GEN) $(RM) $@; \
164         $(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$(srcdir)/$*.fncs' > $*.sgml
165 .sgml.txt:
166         $(AM_V_GEN) $(RM) $@; \
167         $(DOC2TXT) $*.sgml
168 .sgml.pdf:
169         $(AM_V_GEN) $(RM) $@; \
170         $(DOC2PDF) $*.sgml
171 .sgml.html:
172         $(AM_V_GEN) $(RM) $@; \
173         $(DOC2HTML) -u $*.sgml > $@
174 ##
175 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
176         $(AM_V_GEN) $(RM) $@; \
177         $(DOC2MAN) local-fontconfig-user.sgml && \
178         $(RM) manpage.*
179 ##
180 $(man3_MANS): func.refs
181 func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS)
182         $(AM_V_GEN) $(RM) $@; \
183         $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \
184         mv devel-man/manpage.refs func.refs &&  \
185         mv devel-man/*.3 . &&                   \
186         $(RM) devel-man/manpage.* &&            \
187         rmdir devel-man || rm $@ || :
188 confdir.sgml: $(srcdir)/confdir.sgml.in
189         $(AM_V_GEN) sed -e 's,@CONFDIR\@,${CONFDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@
190 ##
191 $(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) edit-sgml$(EXEEXT) $(srcdir)/func.sgml
192 $(TXT_FILES): $(DOCS_DEPS)
193 $(PDF_FILES): $(DOCS_DEPS)
194 $(HTML_FILES): $(DOCS_DEPS)
195 $(HTML_DIR)/*: $(HTML_DIR)
196 $(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS)
197         $(AM_V_GEN) $(RM) -r $@; \
198         $(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml
199 local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml
200         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@;  \
201         [ ! -f $(builddir)/fontconfig-user.sgml ] && cp -a $(srcdir)/fontconfig-user.sgml $(builddir)/fontconfig-user.sgml || :
202 local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml
203         $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-devel.sgml $@; \
204         [ ! -f $(builddir)/fontconfig-devel.sgml ] && cp -a $(srcdir)/fontconfig-devel.sgml $(builddir)/fontconfig-devel.sgml || :
205 #
206 all-local: $(BUILT_DOCS) $(HTML_DIR)/*
207 clean-local:
208         $(RM) -r $(HTML_DIR) devel-man
209         [ "x$(builddir)" != "x$(srcdir)" ] && $(RM) $(builddir)/*.sgml || :
210 dist-local-check-docs-enabled:
211         @true
212 else
213 htmldoc_DATA += $(srcdir)/$(HTML_DIR)/*
214 all-local:
215 clean-local:
216 dist-local-check-docs-enabled:
217         @echo "*** --enable-man must be used in order to make dist"
218         @false
219 endif
220
221 # force doc rebulid after configure
222 dist-hook-local: dist-local-check-docs-enabled
223
224 -include $(top_srcdir)/git.mk