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 cp -p $(abs_srcdir)/$(DOC_MAIN_SGML_FILE) \
57 $(abs_srcdir)/$(DOC_MODULE)-overrides.txt \
58 $(abs_srcdir)/$(DOC_MODULE)-sections.txt \
59 $(abs_srcdir)/$(DOC_MODULE).types \
61 if test "x$(content_files)" != "x" ; then \
62 for file in $(content_files) ; do \
63 test -f $(abs_srcdir)/$$file || \
64 cp -p $(abs_srcdir)/$$file $(abs_builddir)/; \
68 @touch setup-build.stamp
72 # in the case of non-srcdir builds, the built gst directory gets added
73 # to gtk-doc scanning; but only then, to avoid duplicates
74 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
75 @echo '*** Scanning header files ***'
76 if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; \
78 GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \
80 GST_REGISTRY=doc-registry.xml \
81 $(GTKDOC_EXTRA_ENVIRONMENT) \
82 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
83 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
84 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
85 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
86 --module=$(DOC_MODULE) ; \
88 for i in $(SCANOBJ_FILES) ; do \
89 test -f $$i || touch $$i ; \
92 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
94 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
97 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
98 --module=$(DOC_MODULE) \
99 --source-dir=$(DOC_SOURCE_DIR) \
101 --ignore-headers="$(IGNORE_HFILES)"
102 touch scan-build.stamp
104 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
109 ### FIXME: make this error out again when docs are complete
110 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files)
111 @echo '*** Building XML ***'
112 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) | tee sgml-build.log
113 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
114 cp ../version.entities xml
116 touch sgml-build.stamp
118 sgml.stamp: sgml-build.stamp
123 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
124 @echo '*** Building HTML ***'
128 cp ../version.entities ./
129 @mkhtml_options=""; \
130 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
131 if test "$(?)" = "0"; then \
132 mkhtml_options=--path="$(abs_srcdir)"; \
134 cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
135 mv html/index.sgml html/index.sgml.bak
136 $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
137 rm -f html/index.sgml.bak
139 rm -f version.entities
140 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
141 @echo '-- Fixing Crossreferences'
142 gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
143 touch html-build.stamp
147 # clean files copied for nonsrcdir templates build
148 if test x"$(srcdir)" != x. ; then \
149 rm -rf $(DOC_MODULE).types; \
156 clean-local: clean-local-gtkdoc
161 rm -f $(REPORT_FILES) \
162 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
163 rm -rf tmpl/*.sgml.bak
164 rm -f $(DOC_MODULE).hierarchy
165 rm -f *.stamp || true
166 if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
167 rm -f $(DOC_MODULE)-docs.sgml ; \
168 rm -f $(DOC_MODULE).types ; \
169 rm -f $(DOC_MODULE).interfaces ; \
170 rm -f $(DOC_MODULE)-overrides.txt ; \
171 rm -f $(DOC_MODULE).prerequisites ; \
172 rm -f $(DOC_MODULE)-sections.txt ; \
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).devhelp' ; \
193 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp \
194 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
195 if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
196 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
197 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
199 (which gtkdoc-rebase >/dev/null && \
200 gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \
203 if test -d $(DESTDIR)$(TARGET_DIR); then \
204 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \
205 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \
207 echo '-- Nothing to uninstall' ; \
212 # Require gtk-doc when making dist
218 @echo "*** gtk-doc must be installed and enabled in order to make dist"
222 dist-hook: dist-check-gtkdoc dist-hook-local
223 mkdir $(distdir)/html
224 cp html/* $(distdir)/html
225 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
226 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
227 cd $(distdir) && rm -f $(DISTCLEANFILES)
228 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
230 .PHONY : dist-hook-local docs
232 # avoid spurious build errors when distchecking with -jN