1cada03c16c5eeeb555a40978782d46a6c781239
[WebKit-https.git] / Tools / gtk / GNUmakefile.am
1 EXTRA_DIST += \
2         Tools/gtk/common.py \
3         Tools/gtk/generate-feature-defines-files \
4         Tools/gtk/generate-gtkdoc \
5         Tools/gtk/gtkdoc.py
6
7 docs: docs-build.stamp
8 .PHONY : docs
9 DISTCLEANFILES += docs-build.stamp
10
11 docs_build_stamp_list = \
12         Source/WebKit/gtk/docs/webkitenvironment.xml
13
14 if ENABLE_WEBKIT1
15 docs_build_stamp_list += \
16         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
17         Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
18         Source/WebKit/gtk/docs/webkitgtk-sections.txt
19 endif
20
21 if ENABLE_WEBKIT2
22 docs_build_stamp_list += \
23         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
24         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
25         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
26 endif
27
28 docs-build.stamp: $(docs_build_stamp_list)
29         CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
30         @touch docs-build.stamp
31
32 clean-local: doc-clean-local
33 doc-clean-local:
34         @rm -f Documentation/webkitgtk/*~ Documentation/webkitgtk*.bak
35         @rm -f Documentation/webkit2gtk/*~ Documentation/webkit2gtk*.bak
36 distclean-local: doc-distclean-local
37 doc-distclean-local:
38         @rm -rf Documentation
39 maintainer-clean-local: doc-maintainer-clean-local
40 doc-maintainer-clean-local: clean
41         @rm -rf Documentation/webkitgtk Documentation/webkit2gtk
42         -@rmdir Documentation
43
44 install-data-local:
45 if ENABLE_WEBKIT1
46         @installfiles=`echo ./Documentation/webkitgtk/html/*`; \
47         if test "$$installfiles" = './Documentation/webkitgtk/html/*'; \
48         then echo 1>&2 'No documentation to install' ; \
49         else \
50           DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
51           if test -n "$(DOC_MODULE_VERSION)"; then \
52             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
53           else \
54             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
55           fi; \
56           $(mkinstalldirs) $${installdir} ; \
57           for i in $$installfiles; do \
58             echo ' $(INSTALL_DATA) '$$i ; \
59             $(INSTALL_DATA) $$i $${installdir}; \
60           done; \
61           if test -n "$(DOC_MODULE_VERSION)"; then \
62             mv -f $${installdir}/webkitgtk.devhelp2 \
63               $${installdir}/webkitgtk-$(DOC_MODULE_VERSION).devhelp2; \
64           fi; \
65         fi
66 endif
67 if ENABLE_WEBKIT2
68         @installfiles=`echo ./Documentation/webkit2gtk/html/*`; \
69         if test "$$installfiles" = './Documentation/webkit2gtk/html/*'; \
70         then echo 1>&2 'No documentation to install' ; \
71         else \
72           DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
73           if test -n "$(DOC_MODULE_VERSION)"; then \
74             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
75           else \
76             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
77           fi; \
78           $(mkinstalldirs) $${installdir} ; \
79           for i in $$installfiles; do \
80             echo ' $(INSTALL_DATA) '$$i ; \
81             $(INSTALL_DATA) $$i $${installdir}; \
82           done; \
83           if test -n "$(DOC_MODULE_VERSION)"; then \
84             mv -f $${installdir}/webkit2gtk.devhelp2 \
85               $${installdir}/webkit2gtk-$(DOC_MODULE_VERSION).devhelp2; \
86           fi; \
87         fi
88 endif
89 if ENABLE_GTK_DOC
90         @$(AM_V_GEN) PKG_CONFIG=$(PKG_CONFIG) $(PYTHON) $(srcdir)/Tools/gtk/generate-gtkdoc --rebase --virtual-root=$${DESTDIR}
91 endif
92
93 uninstall-local:
94 if ENABLE_WEBKIT1
95         @DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
96         if test -n "$(DOC_MODULE_VERSION)"; then \
97           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
98         else \
99           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
100         fi; \
101         rm -rf $${installdir}
102 endif
103 if ENABLE_WEBKIT2
104         @DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
105         if test -n "$(DOC_MODULE_VERSION)"; then \
106           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
107         else \
108           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
109         fi; \
110         rm -rf $${installdir}
111 endif
112
113 if ENABLE_GTK_DOC
114 noinst_DATA += docs-build.stamp
115 endif
116