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@
20 $(srcdir)/inspect/*.xml \
24 $(DOC_MAIN_SGML_FILE) \
27 $(DOC_MODULE)-sections.txt
29 # we don't add inspect-build.stamp here since this is run manually
30 # by docs maintainers and result is commited to CVS
36 $(srcdir)/tmpl.stamp \
37 $(srcdir)/sgml.stamp \
42 $(DOC_MODULE).hierarchy \
43 $(DOC_MODULE).interfaces \
44 $(DOC_MODULE).prerequisites \
45 .libs/$(DOC_MODULE)-scan.o \
48 # FC3 seems to need -scan.c to be part of CLEANFILES for distcheck
49 # no idea why FC4 can do without
50 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS) $(DOC_MODULE)-scan.c
53 all-local: html-build.stamp
57 # in the case of non-srcdir builds, the built gst directory gets added
58 # to gtk-doc scanning; but only then, to avoid duplicates
59 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
60 @echo '*** Scanning header files ***'
61 if test x"$(srcdir)" != x. ; then \
62 cp $(srcdir)/$(DOC_MODULE).types . ; \
63 chmod u+w $(DOC_MODULE).types ; \
65 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
66 GST_PLUGIN_PATH_ONLY=1 \
67 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
68 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
69 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
70 --module=$(DOC_MODULE) ; \
71 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
73 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
76 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
77 --module=$(DOC_MODULE) \
79 --ignore-headers="$(IGNORE_HFILES)"
80 touch scan-build.stamp
82 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
87 ### FIXME: make this error out again when docs are fixed for 0.9
88 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
89 @echo '*** Rebuilding template files ***'
90 if test x"$(srcdir)" != x. ; then \
91 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
92 touch $(DOC_MODULE)-decl.txt ; \
94 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
95 @cat $(DOC_MODULE)-unused.txt
96 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
99 touch tmpl-build.stamp
101 tmpl.stamp: tmpl-build.stamp
104 #### inspect stuff ####
105 # this is stuff that should be built/updated manually by people that work
108 # only look at the plugins in this module when building inspect .xml stuff
109 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
110 INSPECT_ENVIRONMENT=\
111 GST_PLUGIN_PATH_ONLY=yes \
112 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
113 GST_REGISTRY=$(INSPECT_REGISTRY)
116 # update the element and plugin XML descriptions; store in inspect/
121 rm inspect-build.stamp
122 make inspect-build.stamp
124 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
125 # IFF the output changed; see gtkdoc-mktmpl
126 inspect-build.stamp: inspect
127 @echo '*** Rebuilding plugin inspection files ***'
128 if test x"$(srcdir)" != x. ; then \
129 cp $(srcdir)/inspect.stamp . ; \
130 cp $(srcdir)/inspect-build.stamp . ; \
132 $(INSPECT_ENVIRONMENT) $(PYTHON) \
133 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect; \
134 $(INSPECT_ENVIRONMENT) $(PYTHON) \
135 $(top_srcdir)/common/mangle-tmpl.py tmpl; \
136 echo -n "timestamp" > inspect.stamp; \
137 touch inspect-build.stamp; \
140 inspect.stamp: inspect-build.stamp
145 ### FIXME: make this error out again when docs are fixed for 0.9
146 # first convert inspect/*.xml to xml
147 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
148 @echo '*** Building XML ***'
150 @for a in $(srcdir)/inspect/*.xml; do \
151 xsltproc --stringparam module $(MODULE) \
152 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
154 --module=$(DOC_MODULE) \
155 --source-dir=$(DOC_SOURCE_DIR) \
156 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
157 --output-format=xml \
158 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
161 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
162 cp ../version.entities xml
164 touch sgml-build.stamp
166 sgml.stamp: sgml-build.stamp
171 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(top_srcdir)/common/plugins.xsl
172 @echo '*** Building HTML ***'
173 if test -d html; then rm -rf html; fi
175 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
176 @for f in $(content_files); do cp $(srcdir)/$$f html; done
178 cp ../version.entities html
179 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
180 rm -f html/$(DOC_MAIN_SGML_FILE)
182 rm -f html/version.entities
183 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
184 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
185 @echo '-- Fixing Crossreferences'
186 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
187 touch html-build.stamp
197 maintainer-clean-local: clean
198 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
200 # company: don't delete .sgml and -sections.txt as they're in CVS
201 # FIXME : thomas added all sgml files and some other things to make
202 # make distcheck work
203 distclean-local: clean
204 rm -f $(DOC_MODULE)-decl-list.txt
205 rm -f $(DOC_MODULE)-decl.txt
206 rm -f $(DOC_MODULE)-undocumented.txt
207 rm -f $(DOC_MODULE)-unused.txt
208 rm -rf tmpl/*.sgml.bak
209 rm -f $(DOC_MODULE).hierarchy
210 rm -f *.stamp || true
211 if test x"$(srcdir)" != x. ; then \
212 rm -f $(DOC_MODULE)-docs.sgml ; \
213 rm -f $(DOC_MODULE).types ; \
214 rm -f $(DOC_MODULE).interfaces ; \
215 rm -f $(DOC_MODULE)-overrides.txt ; \
216 rm -f $(DOC_MODULE).prerequisites ; \
217 rm -f $(DOC_MODULE)-sections.txt ; \
218 rm -rf tmpl/*.sgml ; \
222 # thomas: make docs parallel installable; devhelp requires majorminor too
224 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
225 (installfiles=`echo ./html/*.html`; \
226 if test "$$installfiles" = './html/*.html'; \
227 then echo '-- Nothing to install' ; \
229 for i in $$installfiles; do \
230 echo '-- Installing '$$i ; \
231 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
233 pngfiles=`echo ./html/*.png`; \
234 if test "$$pngfiles" != './html/*.png'; then \
235 for i in $$pngfiles; do \
236 echo '-- Installing '$$i ; \
237 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
240 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
241 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
242 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
243 echo '-- Installing $(srcdir)/html/index.sgml' ; \
244 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
245 if test -e $(srcdir)/html/style.css; then \
246 echo '-- Installing $(srcdir)/html/style.css' ; \
247 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
251 (installfiles=`echo ./html/*.html`; \
252 if test "$$installfiles" = './html/*.html'; \
253 then echo '-- Nothing to uninstall' ; \
255 for i in $$installfiles; do \
256 rmfile=`basename $$i` ; \
257 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
258 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
260 pngfiles=`echo ./html/*.png`; \
261 if test "$$pngfiles" != './html/*.png'; then \
262 for i in $$pngfiles; do \
263 rmfile=`basename $$i` ; \
264 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
265 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
268 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
269 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
270 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
271 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
272 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
273 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
274 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
277 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
280 # Require gtk-doc when making dist
286 @echo "*** gtk-doc must be installed and enabled in order to make dist"
290 dist-hook: dist-check-gtkdoc dist-hook-local
291 mkdir $(distdir)/tmpl
293 mkdir $(distdir)/html
294 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
295 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
296 -cp $(srcdir)/html/index.sgml $(distdir)/html
297 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
298 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
300 images=$(HTML_IMAGES) ; \
301 for i in "" $$images ; do \
302 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
305 .PHONY : dist-hook-local