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_MAJORMINOR@
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=`cd $(top_builddir) && pwd` \
86 GST_REGISTRY=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) ../$(DOC_MAIN_SGML_FILE)
134 @mv html/index.sgml html/index.sgml.bak
135 @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
136 @rm -f html/index.sgml.bak
138 @rm -f version.entities
139 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
140 @echo ' DOC Fixing cross-references'
141 @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
142 @touch html-build.stamp
145 @rm -rf xml tmpl html
146 # clean files copied for nonsrcdir templates build
147 @if test x"$(srcdir)" != x. ; then \
148 rm -rf $(DOC_MODULE).types; \
155 clean-local: clean-local-gtkdoc
160 @rm -f $(REPORT_FILES) \
161 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
162 @rm -rf tmpl/*.sgml.bak
163 @rm -f $(DOC_MODULE).hierarchy
164 @rm -f *.stamp || true
165 @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
166 rm -f $(DOC_MAIN_SGML_FILE) ; \
167 rm -f $(DOC_OVERRIDES) ; \
168 rm -f $(DOC_MODULE).types ; \
169 rm -f $(DOC_MODULE).interfaces ; \
170 rm -f $(DOC_MODULE).prerequisites ; \
171 rm -f $(DOC_MODULE)-sections.txt ; \
172 rm -f $(content_files) ; \
173 rm -rf tmpl/*.sgml ; \
177 maintainer-clean-local: clean
178 @cd $(srcdir) && rm -rf html \
179 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
181 # thomas: make docs parallel installable; devhelp requires majorminor too
183 (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \
184 if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \
185 then echo '-- Nothing to install' ; \
187 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
188 for i in $$installfiles; do \
189 echo '-- Installing '$$i ; \
190 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
192 echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp2' ; \
193 if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
194 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
195 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
197 (which gtkdoc-rebase >/dev/null && \
198 gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \
201 if test -d $(DESTDIR)$(TARGET_DIR); then \
202 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \
203 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \
205 echo '-- Nothing to uninstall' ; \
210 # Require gtk-doc when making dist
216 @echo "*** gtk-doc must be installed and enabled in order to make dist"
220 dist-hook: dist-check-gtkdoc dist-hook-local
221 mkdir $(distdir)/html
222 cp html/* $(distdir)/html
223 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
224 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
225 cd $(distdir) && rm -f $(DISTCLEANFILES)
226 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
228 .PHONY : dist-hook-local docs
230 # avoid spurious build errors when distchecking with -jN