Merge branch 'dbus-1.6'
[platform/upstream/dbus.git] / doc / Makefile.am
1 apidir = @htmldir@/api
2
3 # automake normally assumes that man pages are generated files;
4 # these ones aren't, so we need the dist_ prefix to say that they're
5 # their own source code
6 dist_man1_MANS = \
7         dbus-cleanup-sockets.1 \
8         dbus-launch.1 \
9         dbus-monitor.1 \
10         dbus-send.1 \
11         dbus-uuidgen.1
12
13 # on the other hand, this one is generated
14 man1_MANS = \
15         dbus-daemon.1
16
17 MAN_IN_FILES = dbus-daemon.1.in
18
19 MAN_HTML_FILES = \
20         dbus-cleanup-sockets.1.html \
21         dbus-daemon.1.html \
22         dbus-launch.1.html \
23         dbus-monitor.1.html \
24         dbus-send.1.html \
25         dbus-uuidgen.1.html
26
27 DTDS = \
28         busconfig.dtd \
29         introspect.dtd
30
31 dist_doc_DATA = system-activation.txt
32
33 # uploaded and distributed, but not installed
34 STATIC_DOCS = \
35         dbus-faq.xml \
36         dbus-specification.xml \
37         dbus-test-plan.xml \
38         dbus-tutorial.xml \
39         dcop-howto.txt \
40         introspect.xsl \
41         $(DTDS)
42
43 EXTRA_DIST = \
44         file-boilerplate.c \
45         doxygen_to_devhelp.xsl \
46         $(STATIC_DOCS) \
47         $(MAN_IN_FILES)
48
49 html_DATA =
50
51 dist_html_DATA =
52
53 # diagram.png/diagram.svg aren't really HTML, but must go in the same
54 # directory as the HTML to avoid broken links
55 STATIC_HTML = \
56         diagram.png \
57         diagram.svg \
58         $(NULL)
59
60 dist_html_DATA += $(STATIC_HTML)
61
62 XMLTO_OUTPUT=                                   \
63         dbus-faq.html                           \
64         dbus-specification.html                 \
65         dbus-test-plan.html                     \
66         dbus-tutorial.html
67
68 if DBUS_XML_DOCS_ENABLED
69
70 # we distribute these in the tarball so users don't necessarily need xmlto
71 dist_html_DATA += $(XMLTO_OUTPUT)
72
73 dbus-specification.html: dbus-specification.xml
74         $(XMLTO) html-nochunks $<
75
76 dbus-test-plan.html: dbus-test-plan.xml
77         $(XMLTO) html-nochunks $<
78
79 dbus-tutorial.html: dbus-tutorial.xml
80         $(XMLTO) html-nochunks $<
81
82 dbus-faq.html: dbus-faq.xml
83         $(XMLTO) html-nochunks $<
84 endif
85
86 if DBUS_DOXYGEN_DOCS_ENABLED
87 all-local:: doxygen.stamp
88
89 doxygen.stamp: $(wildcard $(top_srcdir)/dbus/*.[ch])
90         $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
91         @touch $@
92
93 if DBUS_HAVE_XSLTPROC
94 html_DATA += dbus.devhelp
95
96 dbus.devhelp: $(srcdir)/doxygen_to_devhelp.xsl doxygen.stamp
97         $(XSLTPROC) -o $@ $< api/xml/index.xml
98 endif
99
100 # this assumes CREATE_SUBDIRS isn't set to YES in Doxyfile
101 # (which it isn't currently)
102 install-data-local:: doxygen.stamp
103         $(MKDIR_P) $(DESTDIR)$(apidir)
104         $(INSTALL_DATA) api/html/* $(DESTDIR)$(apidir)
105
106 uninstall-local::
107         rm -f $(DESTDIR)$(apidir)/*.html
108         rm -f $(DESTDIR)$(apidir)/*.png
109         rm -f $(DESTDIR)$(apidir)/*.css
110         rm -f $(DESTDIR)$(apidir)/*.js
111         rm -f $(DESTDIR)$(htmldir)/*.html
112         rm -f $(DESTDIR)$(docdir)/*.txt
113         rm -f $(DESTDIR)$(htmldir)/*.png
114         rm -f $(DESTDIR)$(htmldir)/*.svg
115         rmdir --ignore-fail-on-non-empty $(DESTDIR)$(apidir) || \
116                 rmdir $(DESTDIR)$(apidir)
117 endif
118
119 if DBUS_HAVE_MAN2HTML
120 html_DATA += $(MAN_HTML_FILES)
121
122 %.1.html: %.1
123         $(AM_V_GEN)( $(MAN2HTML) < $< > $@.tmp && mv $@.tmp $@ )
124 endif
125
126 if DBUS_CAN_UPLOAD_DOCS
127 BONUS_FILES = \
128         $(top_srcdir)/README \
129         $(top_srcdir)/HACKING \
130         $(top_srcdir)/AUTHORS \
131         $(top_srcdir)/NEWS \
132         $(top_srcdir)/COPYING \
133         $(top_srcdir)/ChangeLog
134
135 dbus-docs: $(STATIC_DOCS) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp
136         $(AM_V_at)rm -rf $@ $@.tmp
137         $(AM_V_GEN)$(MKDIR_P) $@.tmp/api
138         $(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp
139         $(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp
140         $(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp
141         $(AM_V_at)cp $(XMLTO_OUTPUT) @abs_builddir@/$@.tmp
142         $(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp
143         $(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp
144         $(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api
145         $(AM_V_at)mv $@.tmp $@
146
147 dbus-docs.tar.gz: dbus-docs
148         $(AM_V_GEN)tar czf $@ $<
149
150 DOC_SERVER = dbus.freedesktop.org
151 DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
152
153 SPECIFICATION_SERVER = specifications.freedesktop.org
154 SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
155
156 maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
157         scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)/
158         rsync -rpvzP --chmod=Dg+s,ug+rwX,o=rX \
159                 dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
160         cd $(srcdir) && scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)/
161 else
162 maintainer-upload-docs:
163         @echo "Can't upload documentation! Re-run configure with"
164         @echo "  --enable-doxygen-docs --enable-xml-docs"
165         @echo "and ensure that man2html is installed."
166         @false
167 endif
168
169 clean-local:
170         rm -f $(html_DATA)
171         rm -rf api
172         rm -rf dbus-docs dbus-docs.tmp
173         rm -f *.1.html
174         rm -f doxygen.stamp
175
176 maintainer-clean-local:
177         rm -f $(XMLTO_OUTPUT)