Yet more cleanups to finish getting 'make distcheck' working This has been
[platform/upstream/fontconfig.git] / doc / Makefile.am
1 #
2 # $Id$
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 Keith Packard not be used in
11 # advertising or publicity pertaining to distribution of the software without
12 # specific, written prior permission.  Keith Packard makes 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 # KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 # EVENT SHALL KEITH PACKARD 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
24 DOC_SRC = $(srcdir)
25 DOC_MODULE = fontconfig
26 DOC2HTML = docbook2html
27 DOC2TXT = docbook2txt
28 DOC2MAN = docbook2man
29
30 TXT = fontconfig-user.txt fontconfig-devel.txt
31 HTML_FILES = fontconfig-user.html
32 HTML_DIR = fontconfig-devel
33 SGML = fontconfig-user.sgml fontconfig-devel.sgml
34 FNCS_TMPL = ${DOC_SRC}/func.sgml
35
36 DOC_FUNCS_FNCS=\
37         fcatomic.fncs \
38         fcblanks.fncs \
39         fccharset.fncs \
40         fcconfig.fncs \
41         fcconstant.fncs \
42         fcfile.fncs \
43         fcfontset.fncs \
44         fcfreetype.fncs \
45         fcinit.fncs \
46         fcmatrix.fncs \
47         fcobjectset.fncs \
48         fcobjecttype.fncs \
49         fcpattern.fncs \
50         fcstring.fncs \
51         fcstrset.fncs \
52         fcvalue.fncs
53
54 DOC_FUNCS_SGML=\
55         fcatomic.sgml \
56         fcblanks.sgml \
57         fccharset.sgml \
58         fcconfig.sgml \
59         fcconstant.sgml \
60         fcfile.sgml \
61         fcfontset.sgml \
62         fcfreetype.sgml \
63         fcinit.sgml \
64         fcmatrix.sgml \
65         fcobjectset.sgml \
66         fcobjecttype.sgml \
67         fcpattern.sgml \
68         fcstring.sgml \
69         fcstrset.sgml \
70         fcvalue.sgml
71
72 man_MANS=fonts-conf.5 @DOCMAN3@
73
74 noinst_PROGRAMS=edit-sgml
75 edit_sgml_SOURCES=edit-sgml.c
76
77 docdir=@DOCDIR@
78
79 DOC_FILES=$(TXT) $(HTML_FILES)
80 LOCAL_DOCS=$(man_MANS) $(DOC_FILES) $(HTML_DIR)/*
81
82 EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(FNCS_TMPL) confdir.sgml.in
83
84 SUFFIXES=.fncs .sgml .txt .html
85
86 if USEDOCBOOK
87
88 .fncs.sgml:
89         $(RM) $@
90         ./edit-sgml $(FNCS_TMPL) < '$<' > $*.sgml
91
92 .sgml.txt:
93         $(RM) $@
94         $(DOC2TXT) $<
95
96 $(man_MANS): func.refs
97
98 func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
99         $(RM) func.refs
100         $(DOC2MAN) local-fontconfig-devel.sgml
101         mv manpage.refs func.refs
102         $(RM) manpage.links
103
104 local-fontconfig-devel.sgml: fontconfig-devel.sgml
105         $(LN_S) $< $@
106
107 $(DOC_FUNCS_SGML): edit-sgml $(FNCS_TMPL)
108
109 fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
110         $(RM) $@
111         $(DOC2MAN) local-fontconfig-user.sgml
112         $(RM) manpage.refs manpage.links
113         
114 local-fontconfig-user.sgml: fontconfig-user.sgml
115         $(LN_S) $< $@
116
117 all-local: $(LOCAL_DOCS)
118
119 clean-local:
120         $(RM) $(man_MANS) $(DOC_FILES) $(DOC_FUNCS_SGML) func.refs
121         $(RM) -r $(HTML_DIR)
122
123 $(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
124         $(RM) -r $(HTML_DIR)
125         $(DOC2HTML) -o $(HTML_DIR) local-fontconfig-devel.sgml
126
127 fontconfig-devel.txt: local-fontconfig-devel.sgml version.sgml confdir.sgml
128         $(RM) $@
129         $(DOC2TXT) local-fontconfig-devel.sgml
130         mv local-fontconfig-devel.txt $@
131
132 fontconfig-user.html: local-fontconfig-user.sgml version.sgml confdir.sgml
133         $(RM) $@ local-$@ $@.tmp
134         $(DOC2HTML) -u local-fontconfig-user.sgml > $@.tmp
135         -test -f local-$@ && mv local-$@ $@
136         -test -f $@ || mv $@.tmp $@
137
138 fontconfig-user.txt: local-fontconfig-user.sgml version.sgml confdir.sgml
139         $(RM) $@
140         $(DOC2TXT) local-fontconfig-user.sgml
141         mv local-fontconfig-user.txt $@
142
143 STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
144 confdir.sgml: ${DOC_SRC}/confdir.sgml.in
145         sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
146
147 CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
148
149 else
150 all-local:
151 clean-local:
152 endif
153
154 htmldocdir=$(docdir)/$(HTML_DIR)
155
156 doc_DATA = $(DOC_FILES)
157
158 htmldoc_DATA = $(HTML_DIR)/*
159
160 $(HTML_DIR)/*: $(HTML_DIR)