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'
73 @if test "x$(top_srcdir)" != "x$(top_builddir)"; \
75 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
78 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
79 --module=$(DOC_MODULE) \
80 --source-dir=$(DOC_SOURCE_DIR) \
82 --ignore-headers="$(IGNORE_HFILES)"
83 @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \
84 echo " DOC Introspecting gobjects"; \
85 GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \
87 GST_REGISTRY=doc-registry.xml \
88 $(GTKDOC_EXTRA_ENVIRONMENT) \
89 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
90 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
91 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
92 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
93 --module=$(DOC_MODULE) ; \
95 for i in $(SCANOBJ_FILES) ; do \
96 test -f $$i || touch $$i ; \
99 @touch scan-build.stamp
101 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
106 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files)
107 @echo ' DOC Building XML'
108 @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)
109 @cp ../version.entities xml
110 @touch sgml-build.stamp
112 sgml.stamp: sgml-build.stamp
117 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
118 @echo ' DOC Building HTML'
122 @cp ../version.entities ./
123 @mkhtml_options=""; \
124 @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
125 if test "$(?)" = "0"; then \
126 mkhtml_options=--path="$(abs_srcdir)"; \
128 cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
129 @mv html/index.sgml html/index.sgml.bak
130 @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
131 @rm -f html/index.sgml.bak
133 @rm -f version.entities
134 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
135 @echo ' DOC Fixing cross-references'
136 @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
137 @touch html-build.stamp
140 @rm -rf xml tmpl html
141 # clean files copied for nonsrcdir templates build
142 @if test x"$(srcdir)" != x. ; then \
143 rm -rf $(DOC_MODULE).types; \
150 clean-local: clean-local-gtkdoc
155 @rm -f $(REPORT_FILES) \
156 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
157 @rm -rf tmpl/*.sgml.bak
158 @rm -f $(DOC_MODULE).hierarchy
159 @rm -f *.stamp || true
160 @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
161 rm -f $(DOC_MAIN_SGML_FILE) ; \
162 rm -f $(DOC_OVERRIDES) ; \
163 rm -f $(DOC_MODULE).types ; \
164 rm -f $(DOC_MODULE).interfaces ; \
165 rm -f $(DOC_MODULE).prerequisites ; \
166 rm -f $(DOC_MODULE)-sections.txt ; \
167 rm -rf tmpl/*.sgml ; \
171 maintainer-clean-local: clean
172 @cd $(srcdir) && rm -rf html \
173 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
175 # thomas: make docs parallel installable; devhelp requires majorminor too
177 (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \
178 if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \
179 then echo '-- Nothing to install' ; \
181 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
182 for i in $$installfiles; do \
183 echo '-- Installing '$$i ; \
184 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
186 echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp2' ; \
187 if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
188 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
189 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
191 (which gtkdoc-rebase >/dev/null && \
192 gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \
195 if test -d $(DESTDIR)$(TARGET_DIR); then \
196 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \
197 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \
199 echo '-- Nothing to uninstall' ; \
204 # Require gtk-doc when making dist
210 @echo "*** gtk-doc must be installed and enabled in order to make dist"
214 dist-hook: dist-check-gtkdoc dist-hook-local
215 mkdir $(distdir)/html
216 cp html/* $(distdir)/html
217 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
218 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
219 cd $(distdir) && rm -f $(DISTCLEANFILES)
220 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
222 .PHONY : dist-hook-local docs
224 # avoid spurious build errors when distchecking with -jN