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) \
35 $(DOC_MODULE)-sections.txt
37 MAINTAINER_DOC_STAMPS = \
42 # we don't add inspect-build.stamp and scanobj-build.stamp here since they are
43 # built manually by docs maintainers and result is commited to CVS
54 # files generated/updated by gtkdoc-scangobj
56 $(DOC_MODULE).signals \
57 $(DOC_MODULE).hierarchy \
58 $(DOC_MODULE).interfaces \
59 $(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
74 all-local: html-build.stamp
76 #### scan gobjects; done by documentation maintainer ####
78 -rm scanobj-build.stamp
79 make scanobj-build.stamp
81 # in the case of non-srcdir builds, the built gst directory gets added
82 # to gtk-doc scanning; but only then, to avoid duplicates
83 # FIXME: since we don't have the scan step as part of the build anymore,
84 # we could remove that
85 # TODO: finish elite script that updates the output files of this step
86 # instead of rewriting them, so that multiple maintainers can generate
87 # a collective set of args and signals
88 scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles)
89 @echo '*** Scanning GObjects ***'
90 if test x"$(srcdir)" != x. ; then \
91 for f in $(SCANOBJ_FILES); \
93 cp $(srcdir)/$$f . ; \
96 $(INSPECT_ENVIRONMENT) \
97 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
98 CFLAGS="-g $(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
99 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
100 --module=$(DOC_MODULE) --source=$(PACKAGE); \
102 touch scanobj-build.stamp
104 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp
107 ### inspect GStreamer plug-ins; done by documentation maintainer ###
109 # only look at the plugins in this module when building inspect .xml stuff
110 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
111 INSPECT_ENVIRONMENT=\
112 GST_PLUGIN_SYSTEM_PATH= \
113 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
114 GST_REGISTRY=$(INSPECT_REGISTRY)
116 # update the element and plugin XML descriptions; store in inspect/
120 inspect-update: inspect
121 -rm $(INSPECT_REGISTRY)
122 -rm inspect-build.stamp
123 make inspect-build.stamp
125 # FIXME: inspect.stamp should be written to by gst-xmlinspect.py
126 # IFF the output changed; see gtkdoc-mktmpl
128 @echo '*** Rebuilding plugin inspection files ***'
129 if test x"$(srcdir)" != x. ; then \
130 cp $(srcdir)/inspect.stamp . ; \
131 cp $(srcdir)/inspect-build.stamp . ; \
133 $(INSPECT_ENVIRONMENT) $(PYTHON) \
134 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect && \
135 echo -n "timestamp" > inspect.stamp && \
136 touch inspect-build.stamp; \
139 ### scan headers; done on every build ###
140 scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp inspect-build.stamp
141 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
143 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
146 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
147 --module=$(DOC_MODULE) \
149 --ignore-headers="$(IGNORE_HFILES)"; \
150 touch scan-build.stamp
152 #### update templates; done on every build ####
154 ### FIXME: make this error out again when docs are fixed for 0.9
155 # in a non-srcdir build, we need to copy files from the previous step
156 # and the files from previous runs of this step
157 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
158 @echo '*** Rebuilding template files ***'
159 if test x"$(srcdir)" != x. ; then \
160 for f in $(SCANOBJ_FILES) $(SCAN_FILES); \
162 if test -e $(srcdir)/$$f; then cp $(srcdir)/$$f . ; fi; \
165 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
167 $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/inspect tmpl
168 @cat $(DOC_MODULE)-unused.txt
170 touch tmpl-build.stamp
172 tmpl.stamp: tmpl-build.stamp
175 #### build xml; done on every build ####
177 ### FIXME: make this error out again when docs are fixed for 0.9
178 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
179 @echo '*** Building XML ***'
181 @for a in $(srcdir)/inspect/*.xml; do \
182 xsltproc --stringparam module $(MODULE) \
183 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
184 @for f in $(EXAMPLE_CFILES); do \
185 $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done
187 --module=$(DOC_MODULE) \
188 --source-dir=$(DOC_SOURCE_DIR) \
189 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
190 --output-format=xml \
191 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
194 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
195 cp ../version.entities xml
197 touch sgml-build.stamp
199 sgml.stamp: sgml-build.stamp
202 #### build html; done on every step ####
204 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
205 @echo '*** Building HTML ***'
206 if test -d html; then rm -rf html; fi
208 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
209 @for f in $(content_files); do cp $(srcdir)/$$f html; done
211 cp ../version.entities html
212 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
213 rm -f html/$(DOC_MAIN_SGML_FILE)
215 rm -f html/version.entities
216 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
217 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
218 @echo '-- Fixing Crossreferences'
219 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
220 touch html-build.stamp
225 # FC3 seems to need -scan.c to be part of CLEANFILES for distcheck
226 # no idea why FC4 can do without
229 $(DOC_MODULE)-scan.c \
230 $(DOC_MODULE)-unused.txt \
234 # FIXME: these rules need a little cleaning up
238 # clean files generated for tmpl build
240 # clean files copied/generated for nonsrcdir tmpl build
241 if test x"$(srcdir)" != x. ; then \
242 rm -rf $(SCANOBJ_FILES) $(SCAN_FILES); \
244 # clean files generated for xml build
246 # clean files generate for html build
249 distclean-local: clean
250 rm -rf tmpl/*.sgml.bak
251 rm -f *.stamp || true
254 # thomas: make docs parallel installable; devhelp requires majorminor too
256 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
257 (installfiles=`echo ./html/*.html`; \
258 if test "$$installfiles" = './html/*.html'; \
259 then echo '-- Nothing to install' ; \
261 for i in $$installfiles; do \
262 echo '-- Installing '$$i ; \
263 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
265 pngfiles=`echo ./html/*.png`; \
266 if test "$$pngfiles" != './html/*.png'; then \
267 for i in $$pngfiles; do \
268 echo '-- Installing '$$i ; \
269 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
272 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
273 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
274 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
275 echo '-- Installing $(srcdir)/html/index.sgml' ; \
276 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
277 if test -e $(srcdir)/html/style.css; then \
278 echo '-- Installing $(srcdir)/html/style.css' ; \
279 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
283 (installfiles=`echo ./html/*.html`; \
284 if test "$$installfiles" = './html/*.html'; \
285 then echo '-- Nothing to uninstall' ; \
287 for i in $$installfiles; do \
288 rmfile=`basename $$i` ; \
289 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
290 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
292 pngfiles=`echo ./html/*.png`; \
293 if test "$$pngfiles" != './html/*.png'; then \
294 for i in $$pngfiles; do \
295 rmfile=`basename $$i` ; \
296 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
297 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
300 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
301 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
302 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
303 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
304 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
305 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
306 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
309 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
312 # Require gtk-doc when making dist
318 @echo "*** gtk-doc must be installed and enabled in order to make dist"
322 # FIXME: decide whether we want to dist generated html or not
323 dist-hook: dist-check-gtkdoc dist-hook-local
324 mkdir $(distdir)/tmpl
326 mkdir $(distdir)/html
327 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
328 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
329 -cp $(srcdir)/html/index.sgml $(distdir)/html
330 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
331 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
333 images=$(HTML_IMAGES) ; \
334 for i in "" $$images ; do \
335 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
338 .PHONY : dist-hook-local