1 ###########################################################################
2 # Everything below here is generic and you shouldn't need to change it.
3 ###########################################################################
4 # thomas: except of course that we did
6 # thomas: copied from glib-2
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 # thomas: make docs parallel installable
15 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@
21 $(DOC_MAIN_SGML_FILE) \
24 $(DOC_MODULE)-sections.txt
36 $(DOC_MODULE).hierarchy \
37 $(DOC_MODULE).interfaces \
38 $(DOC_MODULE).prerequisites \
39 $(DOC_MODULE).signals \
40 .libs/$(DOC_MODULE)-scan.o
43 $(DOC_MODULE)-undocumented.txt \
44 $(DOC_MODULE)-undeclared.txt \
45 $(DOC_MODULE)-unused.txt
47 CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml
50 all-local: html-build.stamp
54 setup-build.stamp: $(content_files)
55 -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
56 echo ' DOC Preparing build'; \
57 files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \
58 if test "x$$files" != "x" ; then \
59 for file in $$files ; do \
60 test -f $(abs_srcdir)/$$file && \
61 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
65 @touch setup-build.stamp
69 # in the case of non-srcdir builds, the built gst directory gets added
70 # to gtk-doc scanning; but only then, to avoid duplicates
71 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
72 @echo ' DOC Scanning header files'
74 for i in $(DOC_SOURCE_DIR) ; do \
75 _source_dir="$${_source_dir} --source-dir=$$i" ; \
78 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
79 --module=$(DOC_MODULE) \
81 --ignore-headers="$(IGNORE_HFILES)"
82 @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \
83 echo " DOC Introspecting gobjects"; \
84 GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \
85 GST_PLUGIN_PATH_1_0= \
86 GST_REGISTRY_1_0=doc-registry.xml \
87 $(GTKDOC_EXTRA_ENVIRONMENT) \
88 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
89 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
90 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
91 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
92 --module=$(DOC_MODULE) ; \
94 for i in $(SCANOBJ_FILES) ; do \
95 test -f $$i || touch $$i ; \
98 @touch scan-build.stamp
100 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
105 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files)
106 @echo ' DOC Building XML'
107 @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS)
108 @cp ../version.entities xml
109 @touch sgml-build.stamp
111 sgml.stamp: sgml-build.stamp
116 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
117 @echo ' DOC Building HTML'
121 @cp ../version.entities ./
122 @mkhtml_options=""; \
123 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
124 if test "$(?)" = "0"; then \
125 if test "x$(V)" = "x1"; then \
126 mkhtml_options="$$mkhtml_options --verbose"; \
129 @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
130 if test "$(?)" = "0"; then \
131 mkhtml_options=--path="$(abs_srcdir)"; \
133 cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE)
135 @rm -f version.entities
136 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
137 @echo ' DOC Fixing cross-references'
138 @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
139 @touch html-build.stamp
142 @rm -rf xml tmpl html
143 # clean files copied for nonsrcdir templates build
144 @if test x"$(srcdir)" != x. ; then \
145 rm -rf $(DOC_MODULE).types; \
152 clean-local: clean-local-gtkdoc
157 @rm -f $(REPORT_FILES) \
158 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
159 @rm -rf tmpl/*.sgml.bak
160 @rm -f $(DOC_MODULE).hierarchy
161 @rm -f *.stamp || true
162 @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
163 rm -f $(DOC_MAIN_SGML_FILE) ; \
164 rm -f $(DOC_OVERRIDES) ; \
165 rm -f $(DOC_MODULE).types ; \
166 rm -f $(DOC_MODULE).interfaces ; \
167 rm -f $(DOC_MODULE).prerequisites ; \
168 rm -f $(DOC_MODULE)-sections.txt ; \
169 rm -f $(content_files) ; \
170 rm -rf tmpl/*.sgml ; \
174 maintainer-clean-local: clean
175 @cd $(srcdir) && rm -rf html \
176 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
178 # thomas: make docs parallel installable; devhelp requires majorminor too
180 (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \
181 if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \
182 then echo '-- Nothing to install' ; \
184 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
185 for i in $$installfiles; do \
186 echo '-- Installing '$$i ; \
187 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
189 echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \
190 if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \
191 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \
192 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \
194 $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \
197 if test -d $(DESTDIR)$(TARGET_DIR); then \
198 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \
199 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \
201 echo '-- Nothing to uninstall' ; \
206 # Require gtk-doc when making dist
212 @echo "*** gtk-doc must be installed and enabled in order to make dist"
216 dist-hook: dist-check-gtkdoc dist-hook-local
217 mkdir $(distdir)/html
218 cp html/* $(distdir)/html
219 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
220 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
221 cd $(distdir) && rm -f $(DISTCLEANFILES)
222 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
224 .PHONY : dist-hook-local docs
226 # avoid spurious build errors when distchecking with -jN