1 # -*- mode: makefile -*-
3 GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
4 GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
5 GTKDOC_RUN = $(LIBTOOL) --mode=execute
7 # We set GPATH here; this gives us semantics for GNU make
8 # which are more like other make's VPATH, when it comes to
9 # whether a source that is a target of one rule is then
10 # searched for in VPATH/GPATH.
14 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
17 $(DOC_MAIN_SGML_FILE) \
18 webkitenvironment.xml \
19 $(DOC_MODULE)-sections.txt \
20 $(DOC_MODULE)-overrides.txt
26 DOC_STAMPS=doc-setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
27 html-build.stamp pdf-build.stamp \
28 tmpl.stamp sgml.stamp html.stamp pdf.stamp
32 $(DOC_MODULE).hierarchy \
33 $(DOC_MODULE).interfaces \
34 $(DOC_MODULE).prerequisites \
38 $(DOC_MODULE)-undocumented.txt \
39 $(DOC_MODULE)-undeclared.txt \
40 $(DOC_MODULE)-unused.txt
42 CLEANFILES += $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
45 HTML_BUILD_STAMP=html-build.stamp
48 doc_srcdir := $(abs_srcdir)/Source/WebKit/gtk/docs
50 docs: $(HTML_BUILD_STAMP)
52 $(REPORT_FILES): sgml-build.stamp
56 doc-setup-build.stamp: libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
57 -@mkdir -p Documentation
58 -@ln -fs ../doltlibtool Documentation/
59 -@ln -fs ../doltcompile Documentation/
60 -@ln -fs ../libtool Documentation/
61 -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
62 echo ' DOC Preparing build'; \
63 files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
64 if test "x$$files" != "x" ; then \
65 for file in $$files ; do \
66 test -f $(doc_srcdir)/$$file && \
67 cp -pu $(doc_srcdir)/$$file $(abs_builddir)/Documentation/ || true; \
70 test -d $(doc_srcdir)/tmpl && \
71 { cp -rp $(doc_srcdir)/tmpl $(abs_builddir)/Documentation/; \
72 chmod -R u+w $(abs_builddir)/Documentation/tmpl; } \
74 @touch doc-setup-build.stamp
78 scan-build.stamp: doc-setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
79 @echo ' DOC Scanning header files'
80 @cd Documentation; _source_dir='' ; \
81 for i in $(DOC_SOURCE_DIR) ; do \
82 _source_dir="$${_source_dir} --source-dir=../$$i" ; \
84 gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
85 @cd Documentation; if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
86 echo " DOC Introspecting gobjects"; \
88 gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
89 if test "$(?)" = "0"; then \
90 if test "x$(V)" = "x1"; then \
91 scanobj_options="--verbose"; \
94 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
95 gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
97 for i in $(SCANOBJ_FILES) ; do \
98 test -f $$i || touch $$i ; \
101 @touch scan-build.stamp
103 Documentation/$(DOC_MODULE)-decl.txt Documentation/$(SCANOBJ_FILES) Documentation/$(DOC_MODULE)-sections.txt Documentation/$(DOC_MODULE)-overrides.txt: scan-build.stamp
108 tmpl-build.stamp: doc-setup-build.stamp Documentation/$(DOC_MODULE)-decl.txt Documentation/$(SCANOBJ_FILES) Documentation/$(DOC_MODULE)-sections.txt Documentation/$(DOC_MODULE)-overrides.txt
109 @echo ' DOC Rebuilding template files'
110 @cd Documentation; gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
111 @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
112 if test -w $(abs_srcdir) ; then \
113 cp -rp $(abs_builddir)/Documentation/tmpl $(doc_srcdir); \
116 @touch tmpl-build.stamp
118 tmpl.stamp: tmpl-build.stamp
121 $(srcdir)/tmpl/*.sgml:
126 sgml-build.stamp: doc-setup-build.stamp tmpl.stamp Documentation/$(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml
127 @echo ' DOC Building XML'
128 @-chmod -R u+w $(srcdir)
129 @cd Documentation; _source_dir='' ; \
130 for i in $(DOC_SOURCE_DIR) ; do \
131 _source_dir="$${_source_dir} --source-dir=../$$i" ; \
133 gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
134 @touch sgml-build.stamp
136 sgml.stamp: sgml-build.stamp
141 Documentation/$(DOC_MAIN_SGML_FILE): sgml.stamp
142 Documentation/webkitenvironment.xml: doc-setup-build.stamp
144 html-build.stamp: sgml.stamp Documentation/$(DOC_MAIN_SGML_FILE)
145 @echo ' DOC Building HTML'
146 @rm -rf Documentation/html
147 @mkdir Documentation/html
148 @cd Documentation; mkhtml_options=""; \
149 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
150 if test "$(?)" = "0"; then \
151 if test "x$(V)" = "x1"; then \
152 mkhtml_options="$$mkhtml_options --verbose"; \
155 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
156 if test "$(?)" = "0"; then \
157 mkhtml_options="$$mkhtml_options --path=\"$(doc_srcdir)\""; \
159 cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
160 -@test "x$(HTML_IMAGES)" = "x" || \
161 for file in $(HTML_IMAGES) ; do \
162 if test -f $(abs_srcdir)/$$file ; then \
163 cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
165 if test -f $(abs_builddir)/$$file ; then \
166 cp $(abs_builddir)/$$file $(abs_builddir)/html; \
169 @echo ' DOC Fixing cross-references'
170 @cd Documentation; gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
171 @touch html-build.stamp
173 clean-local: doc-clean-local
176 @rm -f Documentation/*~ Documentation/*.bak
177 @rm -rf Documentation/.libs
179 distclean-local: doc-distclean-local
182 @rm -rf Documentation
184 maintainer-clean-local: doc-maintainer-clean-local
186 doc-maintainer-clean-local: clean
187 @rm -rf Documentation/xml Documentation/html
188 -@rmdir Documentation
191 # Require gtk-doc when making dist
199 @echo "*** gtk-doc must be installed and enabled in order to make dist"
203 dist-hook: doc-dist-hook
205 doc-dist-hook: dist-check-gtkdoc dist-hook-local
206 @mkdir $(distdir)/tmpl
207 @mkdir $(distdir)/html
208 @-cp ./Documentation/tmpl/*.sgml $(distdir)/tmpl
209 @cp ./Documentation/html/* $(distdir)/html
210 @-cp ./Documentation/$(DOC_MODULE).types $(distdir)/
211 @-cp ./Documentation/$(DOC_MODULE)-sections.txt $(distdir)/
212 @cd $(distdir) && rm -f $(DISTCLEANFILES)
213 @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
215 .PHONY : dist-hook-local docs