Build dbus.devhelp using doxygen_to_devhelp.xsl and install it
[platform/upstream/dbus.git] / doc / Makefile.am
1 apidir = @htmldir@/api
2
3 man_MANS = \
4         dbus-cleanup-sockets.1 \
5         dbus-daemon.1 \
6         dbus-launch.1 \
7         dbus-monitor.1 \
8         dbus-send.1 \
9         dbus-uuidgen.1
10
11 MAN_IN_FILES = dbus-daemon.1.in
12
13 MAN_HTML_FILES = \
14         dbus-cleanup-sockets.1.html \
15         dbus-daemon.1.html \
16         dbus-launch.1.html \
17         dbus-monitor.1.html \
18         dbus-send.1.html \
19         dbus-uuidgen.1.html
20
21 DTDS = \
22         busconfig.dtd \
23         introspect.dtd
24
25 STATIC_DOCS = \
26         diagram.png \
27         diagram.svg \
28         dbus-faq.xml \
29         dbus-specification.xml \
30         dbus-test-plan.xml \
31         dbus-tutorial.xml \
32         dcop-howto.txt \
33         introspect.xsl \
34         system-activation.txt \
35         $(DTDS)
36
37 EXTRA_DIST = \
38         file-boilerplate.c \
39         doxygen_to_devhelp.xsl \
40         $(STATIC_DOCS) \
41         $(MAN_IN_FILES) $(man_MANS)
42
43 HTML_FILES=                                     \
44         dbus-faq.html                           \
45         dbus-specification.html                 \
46         dbus-test-plan.html                     \
47         dbus-tutorial.html
48
49 if DBUS_XML_DOCS_ENABLED
50 all-local:: $(HTML_FILES)
51
52 EXTRA_DIST += $(HTML_FILES)
53
54 dbus-specification.html: dbus-specification.xml
55         $(XMLTO) html-nochunks $<
56
57 dbus-test-plan.html: dbus-test-plan.xml
58         $(XMLTO) html-nochunks $<
59
60 dbus-tutorial.html: dbus-tutorial.xml
61         $(XMLTO) html-nochunks $<
62
63 dbus-faq.html: dbus-faq.xml
64         $(XMLTO) html-nochunks $<
65
66 endif
67
68 if DBUS_DOXYGEN_DOCS_ENABLED
69 all-local:: doxygen.stamp
70
71 doxygen.stamp: $(wildcard $(top_srcdir)/dbus/*.[ch])
72         $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
73         @touch $@
74
75 if DBUS_HAVE_XSLTPROC
76 api_DATA = dbus.devhelp
77
78 dbus.devhelp: $(srcdir)/doxygen_to_devhelp.xsl doxygen.stamp
79         $(XSLTPROC) -o $@ $< api/xml/index.xml
80 endif
81
82 # this assumes CREATE_SUBDIRS isn't set to YES in Doxyfile
83 # (which it isn't currently)
84 install-data-local:: doxygen.stamp
85         $(MKDIR_P) $(DESTDIR)$(apidir)
86         $(INSTALL_DATA) api/html/* $(DESTDIR)$(apidir)
87 endif
88
89 if DBUS_HAVE_MAN2HTML
90 all-local:: $(MAN_HTML_FILES)
91
92 %.1.html: %.1
93         $(AM_V_GEN)( $(MAN2HTML) $< > $@.tmp && mv $@.tmp $@ )
94 endif
95
96 if DBUS_CAN_UPLOAD_DOCS
97 BONUS_FILES = \
98         $(top_srcdir)/README \
99         $(top_srcdir)/HACKING \
100         $(top_srcdir)/AUTHORS \
101         $(top_srcdir)/NEWS \
102         $(top_srcdir)/COPYING \
103         $(top_srcdir)/ChangeLog
104
105 dbus-docs: $(STATIC_DOCS) $(HTML_FILES) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp
106         $(AM_V_at)rm -rf $@
107         $(AM_V_GEN)$(MKDIR_P) $@/api
108         $(AM_V_at)cp $(STATIC_DOCS) $@
109         $(AM_V_at)cp $(HTML_FILES) $@
110         $(AM_V_at)cp $(MAN_HTML_FILES) $@
111         $(AM_V_at)cp $(BONUS_FILES) $@
112         $(AM_V_at)cp -r api/html $@/api
113
114 dbus-docs.tar.gz: dbus-docs
115         $(AM_V_GEN)tar czf $@ $<
116
117 DOC_SERVER = dbus.freedesktop.org
118 DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
119
120 SPECIFICATION_SERVER = specifications.freedesktop.org
121 SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
122
123 maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
124         scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)
125         rsync -rvzP --chmod=Dg+s,ug+rwX,o=rX \
126                 dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
127         scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)
128 else
129 maintainer-upload-docs:
130         @echo "Can't upload documentation! Re-run configure with"
131         @echo "  --enable-doxygen-docs --enable-xml-docs"
132         @echo "and ensure that man2html is installed."
133         @false
134 endif
135
136 clean-local:
137         rm -rf api
138         rm -rf dbus-docs
139         rm -f *.1.html
140
141 maintainer-clean-local:
142         rm -f $(HTML_FILES)