1 # This is an include file specifically tuned for building documentation
2 # for GStreamer plug-ins
5 @echo "If you are a doc maintainer, run 'make update' to update"
6 @echo "the documentation files maintained in CVS"
8 # update the stuff maintained by doc maintainers
13 # We set GPATH here; this gives us semantics for GNU make
14 # which are more like other make's VPATH, when it comes to
15 # whether a source that is a target of one rule is then
16 # searched for in VPATH/GPATH.
20 # thomas: make docs parallel installable
21 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
25 $(srcdir)/inspect/*.xml \
32 $(DOC_MAIN_SGML_FILE) \
34 $(DOC_MODULE)-sections.txt
36 MAINTAINER_DOC_STAMPS = \
41 # we don't add inspect-build.stamp and scanobj-build.stamp here since they are
42 # built manually by docs maintainers and result is commited to CVS
53 # files generated/updated by gtkdoc-scangobj
55 $(DOC_MODULE).signals \
56 $(DOC_MODULE).hierarchy \
57 $(DOC_MODULE).interfaces \
58 $(DOC_MODULE).prerequisites \
63 .libs/$(DOC_MODULE)-scan.o
65 # files generated/updated by gtkdoc-scan
67 $(DOC_MODULE)-sections.txt \
68 $(DOC_MODULE)-overrides.txt \
69 $(DOC_MODULE)-undocumented.txt \
70 $(DOC_MODULE)-decl.txt \
71 $(DOC_MODULE)-decl-list.txt
75 $(DOC_MODULE)-undocumented.txt \
76 $(DOC_MODULE)-undeclared.txt \
77 $(DOC_MODULE)-unused.txt
79 # FC3 seems to need -scan.c to be part of CLEANFILES for distcheck
80 # no idea why FC4 can do without
83 $(DOC_MODULE)-scan.c \
90 all-local: html-build.stamp
92 #### scan gobjects; done by documentation maintainer ####
94 -rm scanobj-build.stamp
95 make scanobj-build.stamp
97 # in the case of non-srcdir builds, the built gst directory gets added
98 # to gtk-doc scanning; but only then, to avoid duplicates
99 # FIXME: since we don't have the scan step as part of the build anymore,
100 # we could remove that
101 # TODO: finish elite script that updates the output files of this step
102 # instead of rewriting them, so that multiple maintainers can generate
103 # a collective set of args and signals
104 scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles)
105 @echo '*** Scanning GObjects ***'
106 if test x"$(srcdir)" != x. ; then \
107 for f in $(SCANOBJ_FILES); \
109 cp $(srcdir)/$$f . ; \
112 $(INSPECT_ENVIRONMENT) \
113 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
114 CFLAGS="-g $(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
115 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
116 --module=$(DOC_MODULE) --source=$(PACKAGE) && \
118 $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE); \
120 touch scanobj-build.stamp
122 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp
125 ### inspect GStreamer plug-ins; done by documentation maintainer ###
127 # only look at the plugins in this module when building inspect .xml stuff
128 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
129 INSPECT_ENVIRONMENT=\
130 GST_PLUGIN_SYSTEM_PATH= \
131 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src \
132 GST_REGISTRY=$(INSPECT_REGISTRY)
134 # update the element and plugin XML descriptions; store in inspect/
138 inspect-update: inspect
139 -rm $(INSPECT_REGISTRY)
140 -rm inspect-build.stamp
141 make inspect-build.stamp
143 # FIXME: inspect.stamp should be written to by gst-xmlinspect.py
144 # IFF the output changed; see gtkdoc-mktmpl
146 @echo '*** Rebuilding plugin inspection files ***'
147 if test x"$(srcdir)" != x. ; then \
148 cp $(srcdir)/inspect.stamp . ; \
149 cp $(srcdir)/inspect-build.stamp . ; \
151 $(INSPECT_ENVIRONMENT) $(PYTHON) \
152 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect && \
153 echo -n "timestamp" > inspect.stamp && \
154 touch inspect-build.stamp; \
157 ### scan headers; done on every build ###
158 scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp inspect-build.stamp
159 if test "x$(top_srcdir)" != "x$(top_builddir)" && \
160 test -d "$(top_builddir)/gst"; \
162 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
165 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
166 --module=$(DOC_MODULE) \
168 --ignore-headers="$(IGNORE_HFILES)"; \
169 touch scan-build.stamp
171 #### update templates; done on every build ####
173 ### FIXME: make this error out again when docs are fixed for 0.9
174 # in a non-srcdir build, we need to copy files from the previous step
175 # and the files from previous runs of this step
176 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
177 @echo '*** Rebuilding template files ***'
178 if test x"$(srcdir)" != x. ; then \
179 for f in $(SCANOBJ_FILES) $(SCAN_FILES); \
181 if test -e $(srcdir)/$$f; then cp $(srcdir)/$$f . ; fi; \
184 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
186 $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/inspect tmpl
187 @cat $(DOC_MODULE)-unused.txt
189 touch tmpl-build.stamp
191 tmpl.stamp: tmpl-build.stamp
194 #### build xml; done on every build ####
196 ### FIXME: make this error out again when docs are fixed for 0.9
197 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
198 @echo '*** Building XML ***'
200 @for a in $(srcdir)/inspect/*.xml; do \
201 xsltproc --stringparam module $(MODULE) \
202 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
203 @for f in $(EXAMPLE_CFILES); do \
204 $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done
206 --module=$(DOC_MODULE) \
207 --source-dir=$(DOC_SOURCE_DIR) \
208 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
209 --output-format=xml \
210 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
213 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
214 cp ../version.entities xml
216 touch sgml-build.stamp
218 sgml.stamp: sgml-build.stamp
221 #### build html; done on every step ####
223 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
224 @echo '*** Building HTML ***'
225 if test -d html; then rm -rf html; fi
227 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
228 @for f in $(content_files); do cp $(srcdir)/$$f html; done
230 cp ../version.entities html
231 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) \
232 2>&1 | tee ../html-build.log
233 @if grep "warning:" html-build.log > /dev/null; then \
234 echo "ERROR"; grep "warning:" html-build.log; exit 1; fi
236 rm -f html/$(DOC_MAIN_SGML_FILE)
238 rm -f html/version.entities
239 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
240 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
241 @echo '-- Fixing Crossreferences'
242 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
243 touch html-build.stamp
248 # FIXME: these rules need a little cleaning up
252 # clean files generated for tmpl build
254 # clean files copied/generated for nonsrcdir tmpl build
255 if test x"$(srcdir)" != x. ; then \
256 rm -rf $(SCANOBJ_FILES) $(SCAN_FILES); \
258 # clean files generated for xml build
260 # clean files generate for html build
263 distclean-local: clean
264 rm -rf tmpl/*.sgml.bak
265 rm -f *.stamp || true
268 # thomas: make docs parallel installable; devhelp requires majorminor too
270 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
271 (installfiles=`echo ./html/*.html`; \
272 if test "$$installfiles" = './html/*.html'; \
273 then echo '-- Nothing to install' ; \
275 for i in $$installfiles; do \
276 echo '-- Installing '$$i ; \
277 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
279 pngfiles=`echo ./html/*.png`; \
280 if test "$$pngfiles" != './html/*.png'; then \
281 for i in $$pngfiles; do \
282 echo '-- Installing '$$i ; \
283 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
286 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
287 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
288 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
289 if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
290 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
291 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
293 echo '-- Installing $(srcdir)/html/index.sgml' ; \
294 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
295 if test -e $(srcdir)/html/style.css; then \
296 echo '-- Installing $(srcdir)/html/style.css' ; \
297 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
301 (installfiles=`echo ./html/*.html`; \
302 if test "$$installfiles" = './html/*.html'; \
303 then echo '-- Nothing to uninstall' ; \
305 for i in $$installfiles; do \
306 rmfile=`basename $$i` ; \
307 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
308 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
310 pngfiles=`echo ./html/*.png`; \
311 if test "$$pngfiles" != './html/*.png'; then \
312 for i in $$pngfiles; do \
313 rmfile=`basename $$i` ; \
314 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
315 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
318 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
319 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
320 if test -e $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \
321 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
323 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
324 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
325 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
326 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
327 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
330 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
335 check-hierarchy: $(DOC_MODULE).hierarchy
336 @if grep ' ' $(DOC_MODULE).hierarchy; then \
337 echo "$(DOC_MODULE).hierarchy contains tabs, please fix"; \
341 check: check-hierarchy
345 # Require gtk-doc when making dist
351 @echo "*** gtk-doc must be installed and enabled in order to make dist"
355 # FIXME: decide whether we want to dist generated html or not
356 dist-hook: dist-check-gtkdoc dist-hook-local
357 mkdir $(distdir)/tmpl
359 mkdir $(distdir)/html
360 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
361 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
362 -cp $(srcdir)/html/index.sgml $(distdir)/html
363 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
364 -cp $(srcdir)/html/$(DOC_MODULE).devhelp* $(distdir)/html
366 images=$(HTML_IMAGES) ; \
367 for i in "" $$images ; do \
368 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
371 .PHONY : dist-hook-local