Install dbus.devhelp to $(htmldir), not $(apidir), and remove it in clean
[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 STATIC_DOCS = \
32         diagram.png \
33         diagram.svg \
34         dbus-faq.xml \
35         dbus-specification.xml \
36         dbus-test-plan.xml \
37         dbus-tutorial.xml \
38         dcop-howto.txt \
39         introspect.xsl \
40         system-activation.txt \
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 HTML_FILES=                                     \
52         dbus-faq.html                           \
53         dbus-specification.html                 \
54         dbus-test-plan.html                     \
55         dbus-tutorial.html
56
57 if DBUS_XML_DOCS_ENABLED
58 all-local:: $(HTML_FILES)
59
60 EXTRA_DIST += $(HTML_FILES)
61
62 dbus-specification.html: dbus-specification.xml
63         $(XMLTO) html-nochunks $<
64
65 dbus-test-plan.html: dbus-test-plan.xml
66         $(XMLTO) html-nochunks $<
67
68 dbus-tutorial.html: dbus-tutorial.xml
69         $(XMLTO) html-nochunks $<
70
71 dbus-faq.html: dbus-faq.xml
72         $(XMLTO) html-nochunks $<
73
74 endif
75
76 if DBUS_DOXYGEN_DOCS_ENABLED
77 all-local:: doxygen.stamp
78
79 doxygen.stamp: $(wildcard $(top_srcdir)/dbus/*.[ch])
80         $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
81         @touch $@
82
83 if DBUS_HAVE_XSLTPROC
84 html_DATA += dbus.devhelp
85
86 dbus.devhelp: $(srcdir)/doxygen_to_devhelp.xsl doxygen.stamp
87         $(XSLTPROC) -o $@ $< api/xml/index.xml
88 endif
89
90 # this assumes CREATE_SUBDIRS isn't set to YES in Doxyfile
91 # (which it isn't currently)
92 install-data-local:: doxygen.stamp
93         $(MKDIR_P) $(DESTDIR)$(apidir)
94         $(INSTALL_DATA) api/html/* $(DESTDIR)$(apidir)
95
96 uninstall-local::
97         rm -f $(DESTDIR)$(apidir)/*.html
98         rm -f $(DESTDIR)$(apidir)/*.png
99         rm -f $(DESTDIR)$(apidir)/*.css
100         rmdir --ignore-fail-on-non-empty $(DESTDIR)$(apidir) || \
101                 rmdir $(DESTDIR)$(apidir)
102 endif
103
104 if DBUS_HAVE_MAN2HTML
105 all-local:: $(MAN_HTML_FILES)
106
107 %.1.html: %.1
108         $(AM_V_GEN)( $(MAN2HTML) $< > $@.tmp && mv $@.tmp $@ )
109 endif
110
111 if DBUS_CAN_UPLOAD_DOCS
112 BONUS_FILES = \
113         $(top_srcdir)/README \
114         $(top_srcdir)/HACKING \
115         $(top_srcdir)/AUTHORS \
116         $(top_srcdir)/NEWS \
117         $(top_srcdir)/COPYING \
118         $(top_srcdir)/ChangeLog
119
120 dbus-docs: $(STATIC_DOCS) $(HTML_FILES) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp
121         $(AM_V_at)rm -rf $@
122         $(AM_V_GEN)$(MKDIR_P) $@/api
123         $(AM_V_at)cp $(STATIC_DOCS) $@
124         $(AM_V_at)cp $(HTML_FILES) $@
125         $(AM_V_at)cp $(MAN_HTML_FILES) $@
126         $(AM_V_at)cp $(BONUS_FILES) $@
127         $(AM_V_at)cp -r api/html $@/api
128
129 dbus-docs.tar.gz: dbus-docs
130         $(AM_V_GEN)tar czf $@ $<
131
132 DOC_SERVER = dbus.freedesktop.org
133 DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
134
135 SPECIFICATION_SERVER = specifications.freedesktop.org
136 SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
137
138 maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
139         scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)
140         rsync -rpvzP --chmod=Dg+s,ug+rwX,o=rX \
141                 dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
142         scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)
143 else
144 maintainer-upload-docs:
145         @echo "Can't upload documentation! Re-run configure with"
146         @echo "  --enable-doxygen-docs --enable-xml-docs"
147         @echo "and ensure that man2html is installed."
148         @false
149 endif
150
151 clean-local:
152         rm -f $(html_DATA)
153         rm -rf api
154         rm -rf dbus-docs
155         rm -f *.1.html
156         rm -f doxygen.stamp
157
158 maintainer-clean-local:
159         rm -f $(HTML_FILES)