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
26 # we don't add inspect-build.stamp here since this is run manually
27 # by docs maintainers and result is commited to CVS
33 $(srcdir)/tmpl.stamp \
34 $(srcdir)/sgml.stamp \
39 $(DOC_MODULE).hierarchy \
40 $(DOC_MODULE).interfaces \
41 $(DOC_MODULE).prerequisites \
42 .libs/$(DOC_MODULE)-scan.o \
45 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
48 all-local: html-build.stamp
52 # in the case of non-srcdir builds, the built gst directory gets added
53 # to gtk-doc scanning; but only then, to avoid duplicates
54 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
55 @echo '*** Scanning header files ***'
56 if test x"$(srcdir)" != x. ; then \
57 cp $(srcdir)/$(DOC_MODULE).types . ; \
58 chmod u+w $(DOC_MODULE).types ; \
60 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
61 GST_PLUGIN_PATH_ONLY=1 \
62 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
63 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
64 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
65 --module=$(DOC_MODULE) ; \
66 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
68 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
71 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
72 --module=$(DOC_MODULE) \
74 --ignore-headers="$(IGNORE_HFILES)"
75 touch scan-build.stamp
77 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
82 ### FIXME: make this error out again when docs are fixed for 0.9
83 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
84 @echo '*** Rebuilding template files ***'
85 if test x"$(srcdir)" != x. ; then \
86 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
87 touch $(DOC_MODULE)-decl.txt ; \
89 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
90 @cat $(DOC_MODULE)-unused.txt
91 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
94 touch tmpl-build.stamp
96 tmpl.stamp: tmpl-build.stamp
99 #### inspect stuff ####
100 # this is stuff that should be built/updated manually by people that work
103 # only look at the plugins in this module when building inspect .xml stuff
104 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
105 INSPECT_ENVIRONMENT=\
106 GST_PLUGIN_PATH_ONLY=yes \
107 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
108 GST_REGISTRY=$(INSPECT_REGISTRY)
111 # update the element and plugin XML descriptions; store in inspect/
116 rm inspect-build.stamp
117 make inspect-build.stamp
119 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
120 # IFF the output changed; see gtkdoc-mktmpl
121 inspect-build.stamp: inspect
122 @echo '*** Rebuilding plugin inspection files ***'
123 if test x"$(srcdir)" != x. ; then \
124 cp $(srcdir)/inspect.stamp . ; \
125 cp $(srcdir)/inspect-build.stamp . ; \
127 $(INSPECT_ENVIRONMENT) $(PYTHON) \
128 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect; \
129 $(INSPECT_ENVIRONMENT) $(PYTHON) \
130 $(top_srcdir)/common/mangle-tmpl.py tmpl; \
131 echo -n "timestamp" > inspect.stamp; \
132 touch inspect-build.stamp; \
135 inspect.stamp: inspect-build.stamp
140 ### FIXME: make this error out again when docs are fixed for 0.9
141 # first convert inspect/*.xml to xml
142 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
143 @echo '*** Building XML ***'
145 @for a in $(srcdir)/inspect/*.xml; do \
146 xsltproc --stringparam module $(MODULE) \
147 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
149 --module=$(DOC_MODULE) \
150 --source-dir=$(DOC_SOURCE_DIR) \
151 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
152 --output-format=xml \
153 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
156 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
157 cp ../version.entities xml
159 touch sgml-build.stamp
161 sgml.stamp: sgml-build.stamp
166 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(top_srcdir)/common/plugins.xsl
167 @echo '*** Building HTML ***'
168 if test -d html; then rm -rf html; fi
170 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
171 @for f in $(content_files); do cp $(srcdir)/$$f html; done
173 cp ../version.entities html
174 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
175 rm -f html/$(DOC_MAIN_SGML_FILE)
177 rm -f html/version.entities
178 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
179 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
180 @echo '-- Fixing Crossreferences'
181 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
182 touch html-build.stamp
192 maintainer-clean-local: clean
193 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
195 # company: don't delete .sgml and -sections.txt as they're in CVS
196 # FIXME : thomas added all sgml files and some other things to make
197 # make distcheck work
198 distclean-local: clean
199 rm -f $(DOC_MODULE)-decl-list.txt
200 rm -f $(DOC_MODULE)-decl.txt
201 rm -f $(DOC_MODULE)-undocumented.txt
202 rm -f $(DOC_MODULE)-unused.txt
203 rm -rf tmpl/*.sgml.bak
204 rm -f $(DOC_MODULE).hierarchy
205 rm -f *.stamp || true
206 if test x"$(srcdir)" != x. ; then \
207 rm -f $(DOC_MODULE)-docs.sgml ; \
208 rm -f $(DOC_MODULE).types ; \
209 rm -f $(DOC_MODULE).interfaces ; \
210 rm -f $(DOC_MODULE)-overrides.txt ; \
211 rm -f $(DOC_MODULE).prerequisites ; \
212 rm -f $(DOC_MODULE)-sections.txt ; \
213 rm -rf tmpl/*.sgml ; \
217 # thomas: make docs parallel installable; devhelp requires majorminor too
219 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
220 (installfiles=`echo ./html/*.html`; \
221 if test "$$installfiles" = './html/*.html'; \
222 then echo '-- Nothing to install' ; \
224 for i in $$installfiles; do \
225 echo '-- Installing '$$i ; \
226 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
228 pngfiles=`echo ./html/*.png`; \
229 if test "$$pngfiles" != './html/*.png'; then \
230 for i in $$pngfiles; do \
231 echo '-- Installing '$$i ; \
232 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
235 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
236 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
237 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
238 echo '-- Installing $(srcdir)/html/index.sgml' ; \
239 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
240 if test -e $(srcdir)/html/style.css; then \
241 echo '-- Installing $(srcdir)/html/style.css' ; \
242 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
246 (installfiles=`echo ./html/*.html`; \
247 if test "$$installfiles" = './html/*.html'; \
248 then echo '-- Nothing to uninstall' ; \
250 for i in $$installfiles; do \
251 rmfile=`basename $$i` ; \
252 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
253 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
255 pngfiles=`echo ./html/*.png`; \
256 if test "$$pngfiles" != './html/*.png'; then \
257 for i in $$pngfiles; do \
258 rmfile=`basename $$i` ; \
259 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
260 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
263 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
264 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
265 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
266 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
267 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
268 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
269 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
272 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
275 # Require gtk-doc when making dist
281 @echo "*** gtk-doc must be installed and enabled in order to make dist"
285 dist-hook: dist-check-gtkdoc dist-hook-local
286 mkdir $(distdir)/tmpl
288 mkdir $(distdir)/html
289 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
290 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
291 -cp $(srcdir)/html/index.sgml $(distdir)/html
292 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
293 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
295 images=$(HTML_IMAGES) ; \
296 for i in "" $$images ; do \
297 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
300 .PHONY : dist-hook-local