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) \
23 $(DOC_MODULE)-sections.txt
25 # we don't add inspect-build.stamp here since this is run manually
26 # by docs maintainers and result is commited to CVS
32 $(srcdir)/tmpl.stamp \
33 $(srcdir)/sgml.stamp \
38 $(DOC_MODULE).hierarchy \
39 $(DOC_MODULE).interfaces \
40 $(DOC_MODULE).prerequisites \
41 .libs/$(DOC_MODULE)-scan.o \
44 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
47 all-local: html-build.stamp
51 # in the case of non-srcdir builds, the built gst directory gets added
52 # to gtk-doc scanning; but only then, to avoid duplicates
53 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
54 @echo '*** Scanning header files ***'
55 if test x"$(srcdir)" != x. ; then \
56 cp $(srcdir)/$(DOC_MODULE).types . ; \
57 chmod u+w $(DOC_MODULE).types ; \
59 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
60 GST_PLUGIN_PATH_ONLY=1 \
61 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
62 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
63 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
64 --module=$(DOC_MODULE) ; \
65 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
67 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
70 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
71 --module=$(DOC_MODULE) \
73 --ignore-headers="$(IGNORE_HFILES)"
74 touch scan-build.stamp
76 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
81 ### FIXME: make this error out again when docs are fixed for 0.9
82 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
83 @echo '*** Rebuilding template files ***'
84 if test x"$(srcdir)" != x. ; then \
85 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
86 touch $(DOC_MODULE)-decl.txt ; \
88 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
89 @cat $(DOC_MODULE)-unused.txt
90 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
93 touch tmpl-build.stamp
95 tmpl.stamp: tmpl-build.stamp
98 #### inspect stuff ####
99 # this is stuff that should be built/updated manually by people that work
102 # only look at the plugins in this module when building inspect .xml stuff
103 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
104 INSPECT_ENVIRONMENT=\
105 GST_PLUGIN_PATH_ONLY=yes \
106 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
107 GST_REGISTRY=$(INSPECT_REGISTRY)
110 # update the element and plugin XML descriptions; store in inspect/
115 rm inspect-build.stamp
116 make inspect-build.stamp
118 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
119 # IFF the output changed; see gtkdoc-mktmpl
120 inspect-build.stamp: inspect
121 $(INSPECT_ENVIRONMENT) $(PYTHON) \
122 $(top_srcdir)/common/gst-xmlinspect.py inspect
123 $(INSPECT_ENVIRONMENT) $(PYTHON) \
124 $(top_srcdir)/common/mangle-tmpl.py tmpl
125 echo -n "timestamp" > inspect.stamp
126 touch inspect-build.stamp
128 inspect.stamp: inspect-build.stamp
133 ### FIXME: make this error out again when docs are fixed for 0.9
134 # first convert inspect/*.xml to xml
135 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
136 @echo '*** Building XML ***'
138 @for a in inspect/*.xml; do \
139 xsltproc --stringparam module $(MODULE) \
140 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
142 --module=$(DOC_MODULE) \
143 --source-dir=$(DOC_SOURCE_DIR) \
144 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
145 --output-format=xml \
146 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
149 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
150 cp ../version.entities xml
152 touch sgml-build.stamp
154 sgml.stamp: sgml-build.stamp
159 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(top_srcdir)/common/plugins.xsl
160 @echo '*** Building HTML ***'
161 if test -d html; then rm -rf html; fi
163 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
164 @for f in $(content_files); do cp $(srcdir)/$$f html; done
166 cp ../version.entities html
167 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
168 rm -f html/$(DOC_MAIN_SGML_FILE)
170 rm -f html/version.entities
171 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
172 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
173 @echo '-- Fixing Crossreferences'
174 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
175 touch html-build.stamp
185 maintainer-clean-local: clean
186 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
188 # company: don't delete .sgml and -sections.txt as they're in CVS
189 # FIXME : thomas added all sgml files and some other things to make
190 # make distcheck work
191 distclean-local: clean
192 rm -f $(DOC_MODULE)-decl-list.txt
193 rm -f $(DOC_MODULE)-decl.txt
194 rm -f $(DOC_MODULE)-undocumented.txt
195 rm -f $(DOC_MODULE)-unused.txt
196 rm -rf tmpl/*.sgml.bak
197 rm -f $(DOC_MODULE).hierarchy
198 rm -f *.stamp || true
199 if test x"$(srcdir)" != x. ; then \
200 rm -f $(DOC_MODULE)-docs.sgml ; \
201 rm -f $(DOC_MODULE).types ; \
202 rm -f $(DOC_MODULE).interfaces ; \
203 rm -f $(DOC_MODULE)-overrides.txt ; \
204 rm -f $(DOC_MODULE).prerequisites ; \
205 rm -f $(DOC_MODULE)-sections.txt ; \
206 rm -rf tmpl/*.sgml ; \
210 # thomas: make docs parallel installable; devhelp requires majorminor too
212 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
213 (installfiles=`echo ./html/*.html`; \
214 if test "$$installfiles" = './html/*.html'; \
215 then echo '-- Nothing to install' ; \
217 for i in $$installfiles; do \
218 echo '-- Installing '$$i ; \
219 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
221 pngfiles=`echo ./html/*.png`; \
222 if test "$$pngfiles" != './html/*.png'; then \
223 for i in $$pngfiles; do \
224 echo '-- Installing '$$i ; \
225 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
228 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
229 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
230 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
231 echo '-- Installing $(srcdir)/html/index.sgml' ; \
232 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
233 if test -e $(srcdir)/html/style.css; then \
234 echo '-- Installing $(srcdir)/html/style.css' ; \
235 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
239 (installfiles=`echo ./html/*.html`; \
240 if test "$$installfiles" = './html/*.html'; \
241 then echo '-- Nothing to uninstall' ; \
243 for i in $$installfiles; do \
244 rmfile=`basename $$i` ; \
245 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
246 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
248 pngfiles=`echo ./html/*.png`; \
249 if test "$$pngfiles" != './html/*.png'; then \
250 for i in $$pngfiles; do \
251 rmfile=`basename $$i` ; \
252 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
253 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
256 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
257 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
258 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
259 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
260 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
261 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
262 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
265 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
268 # Require gtk-doc when making dist
274 @echo "*** gtk-doc must be installed and enabled in order to make dist"
278 dist-hook: dist-check-gtkdoc dist-hook-local
279 mkdir $(distdir)/tmpl
281 mkdir $(distdir)/html
282 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
283 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
284 -cp $(srcdir)/html/index.sgml $(distdir)/html
285 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
286 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
288 images=$(HTML_IMAGES) ; \
289 for i in "" $$images ; do \
290 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
293 .PHONY : dist-hook-local