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 files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \
57 if test "x$$files" != "x" ; then \
58 for file in $$files ; do \
59 test -f $(abs_srcdir)/$$file && \
60 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
64 @touch setup-build.stamp
68 # in the case of non-srcdir builds, the built gst directory gets added
69 # to gtk-doc scanning; but only then, to avoid duplicates
70 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
71 @echo '*** Scanning header files ***'
72 @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; \
74 GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \
76 GST_REGISTRY=doc-registry.xml \
77 $(GTKDOC_EXTRA_ENVIRONMENT) \
78 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
79 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
80 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
81 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
82 --module=$(DOC_MODULE) ; \
84 for i in $(SCANOBJ_FILES) ; do \
85 test -f $$i || touch $$i ; \
88 @if test "x$(top_srcdir)" != "x$(top_builddir)"; \
90 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
93 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
94 --module=$(DOC_MODULE) \
95 --source-dir=$(DOC_SOURCE_DIR) \
97 --ignore-headers="$(IGNORE_HFILES)"
98 @touch scan-build.stamp
100 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
105 ### FIXME: make this error out again when docs are complete
106 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files)
107 @echo '*** 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 '*** 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 '-- Fixing Crossreferences'
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).devhelp' ; \
187 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp \
188 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
189 if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
190 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
191 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
193 (which gtkdoc-rebase >/dev/null && \
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