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 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
51 all-local: html-build.stamp
55 # in the case of non-srcdir builds, the built gst directory gets added
56 # to gtk-doc scanning; but only then, to avoid duplicates
57 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
58 @echo '*** Scanning header files ***'
59 if test x"$(srcdir)" != x. ; then \
60 cp $(srcdir)/$(DOC_MODULE).types . ; \
61 chmod u+w $(DOC_MODULE).types ; \
63 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
64 GST_PLUGIN_PATH_ONLY=1 \
65 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
66 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
67 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
68 --module=$(DOC_MODULE) ; \
69 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
71 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
74 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
75 --module=$(DOC_MODULE) \
77 --ignore-headers="$(IGNORE_HFILES)"
78 touch scan-build.stamp
80 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
85 ### FIXME: make this error out again when docs are fixed for 0.9
86 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
87 @echo '*** Rebuilding template files ***'
88 if test x"$(srcdir)" != x. ; then \
89 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
90 touch $(DOC_MODULE)-decl.txt ; \
92 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
93 @cat $(DOC_MODULE)-unused.txt
94 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
97 touch tmpl-build.stamp
99 tmpl.stamp: tmpl-build.stamp
102 #### inspect stuff ####
103 # this is stuff that should be built/updated manually by people that work
106 # only look at the plugins in this module when building inspect .xml stuff
107 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
108 INSPECT_ENVIRONMENT=\
109 GST_PLUGIN_PATH_ONLY=yes \
110 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
111 GST_REGISTRY=$(INSPECT_REGISTRY)
114 # update the element and plugin XML descriptions; store in inspect/
119 rm inspect-build.stamp
120 make inspect-build.stamp
122 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
123 # IFF the output changed; see gtkdoc-mktmpl
124 inspect-build.stamp: inspect
125 @echo '*** Rebuilding plugin inspection files ***'
126 if test x"$(srcdir)" != x. ; then \
127 cp $(srcdir)/inspect.stamp . ; \
128 cp $(srcdir)/inspect-build.stamp . ; \
130 $(INSPECT_ENVIRONMENT) $(PYTHON) \
131 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect; \
132 $(INSPECT_ENVIRONMENT) $(PYTHON) \
133 $(top_srcdir)/common/mangle-tmpl.py tmpl; \
134 echo -n "timestamp" > inspect.stamp; \
135 touch inspect-build.stamp; \
138 inspect.stamp: inspect-build.stamp
143 ### FIXME: make this error out again when docs are fixed for 0.9
144 # first convert inspect/*.xml to xml
145 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
146 @echo '*** Building XML ***'
148 @for a in $(srcdir)/inspect/*.xml; do \
149 xsltproc --stringparam module $(MODULE) \
150 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
152 --module=$(DOC_MODULE) \
153 --source-dir=$(DOC_SOURCE_DIR) \
154 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
155 --output-format=xml \
156 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
159 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
160 cp ../version.entities xml
162 touch sgml-build.stamp
164 sgml.stamp: sgml-build.stamp
169 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(top_srcdir)/common/plugins.xsl
170 @echo '*** Building HTML ***'
171 if test -d html; then rm -rf html; fi
173 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
174 @for f in $(content_files); do cp $(srcdir)/$$f html; done
176 cp ../version.entities html
177 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
178 rm -f html/$(DOC_MAIN_SGML_FILE)
180 rm -f html/version.entities
181 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
182 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
183 @echo '-- Fixing Crossreferences'
184 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
185 touch html-build.stamp
195 maintainer-clean-local: clean
196 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
198 # company: don't delete .sgml and -sections.txt as they're in CVS
199 # FIXME : thomas added all sgml files and some other things to make
200 # make distcheck work
201 distclean-local: clean
202 rm -f $(DOC_MODULE)-decl-list.txt
203 rm -f $(DOC_MODULE)-decl.txt
204 rm -f $(DOC_MODULE)-undocumented.txt
205 rm -f $(DOC_MODULE)-unused.txt
206 rm -rf tmpl/*.sgml.bak
207 rm -f $(DOC_MODULE).hierarchy
208 rm -f *.stamp || true
209 if test x"$(srcdir)" != x. ; then \
210 rm -f $(DOC_MODULE)-docs.sgml ; \
211 rm -f $(DOC_MODULE).types ; \
212 rm -f $(DOC_MODULE).interfaces ; \
213 rm -f $(DOC_MODULE)-overrides.txt ; \
214 rm -f $(DOC_MODULE).prerequisites ; \
215 rm -f $(DOC_MODULE)-sections.txt ; \
216 rm -rf tmpl/*.sgml ; \
220 # thomas: make docs parallel installable; devhelp requires majorminor too
222 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
223 (installfiles=`echo ./html/*.html`; \
224 if test "$$installfiles" = './html/*.html'; \
225 then echo '-- Nothing to install' ; \
227 for i in $$installfiles; do \
228 echo '-- Installing '$$i ; \
229 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
231 pngfiles=`echo ./html/*.png`; \
232 if test "$$pngfiles" != './html/*.png'; then \
233 for i in $$pngfiles; do \
234 echo '-- Installing '$$i ; \
235 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
238 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
239 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
240 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
241 echo '-- Installing $(srcdir)/html/index.sgml' ; \
242 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
243 if test -e $(srcdir)/html/style.css; then \
244 echo '-- Installing $(srcdir)/html/style.css' ; \
245 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
249 (installfiles=`echo ./html/*.html`; \
250 if test "$$installfiles" = './html/*.html'; \
251 then echo '-- Nothing to uninstall' ; \
253 for i in $$installfiles; do \
254 rmfile=`basename $$i` ; \
255 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
256 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
258 pngfiles=`echo ./html/*.png`; \
259 if test "$$pngfiles" != './html/*.png'; then \
260 for i in $$pngfiles; do \
261 rmfile=`basename $$i` ; \
262 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
263 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
266 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
267 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
268 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
269 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
270 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
271 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
272 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
275 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
278 # Require gtk-doc when making dist
284 @echo "*** gtk-doc must be installed and enabled in order to make dist"
288 dist-hook: dist-check-gtkdoc dist-hook-local
289 mkdir $(distdir)/tmpl
291 mkdir $(distdir)/html
292 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
293 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
294 -cp $(srcdir)/html/index.sgml $(distdir)/html
295 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
296 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
298 images=$(HTML_IMAGES) ; \
299 for i in "" $$images ; do \
300 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
303 .PHONY : dist-hook-local