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/
114 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
115 # IFF the output changed; see gtkdoc-mktmpl
116 inspect-build.stamp: inspect
117 $(INSPECT_ENVIRONMENT) $(PYTHON) \
118 $(top_srcdir)/common/gst-xmlinspect.py inspect
119 $(INSPECT_ENVIRONMENT) $(PYTHON) \
120 $(top_srcdir)/common/mangle-tmpl.py tmpl
121 echo -n "timestamp" > inspect.stamp
122 touch inspect-build.stamp
124 inspect.stamp: inspect-build.stamp
129 ### FIXME: make this error out again when docs are fixed for 0.9
130 # first convert inspect/*.xml to xml
131 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB)
132 @echo '*** Building XML ***'
134 @for a in inspect/*.xml; do \
135 xsltproc $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
137 --module=$(DOC_MODULE) \
138 --source-dir=$(DOC_SOURCE_DIR) \
139 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
140 --output-format=xml \
141 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
144 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
145 cp ../version.entities xml
147 touch sgml-build.stamp
149 sgml.stamp: sgml-build.stamp
154 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
155 @echo '*** Building HTML ***'
156 if test -d html; then rm -rf html; fi
158 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
159 @for f in $(content_files); do cp $(srcdir)/$$f html; done
161 cp ../version.entities html
162 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
163 rm -f html/$(DOC_MAIN_SGML_FILE)
165 rm -f html/version.entities
166 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
167 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
168 @echo '-- Fixing Crossreferences'
169 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
170 touch html-build.stamp
180 maintainer-clean-local: clean
181 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
183 # company: don't delete .sgml and -sections.txt as they're in CVS
184 # FIXME : thomas added all sgml files and some other things to make
185 # make distcheck work
186 distclean-local: clean
187 rm -f $(DOC_MODULE)-decl-list.txt
188 rm -f $(DOC_MODULE)-decl.txt
189 rm -f $(DOC_MODULE)-undocumented.txt
190 rm -f $(DOC_MODULE)-unused.txt
191 rm -rf tmpl/*.sgml.bak
192 rm -f $(DOC_MODULE).hierarchy
193 rm -f *.stamp || true
194 if test x"$(srcdir)" != x. ; then \
195 rm -f $(DOC_MODULE)-docs.sgml ; \
196 rm -f $(DOC_MODULE).types ; \
197 rm -f $(DOC_MODULE).interfaces ; \
198 rm -f $(DOC_MODULE)-overrides.txt ; \
199 rm -f $(DOC_MODULE).prerequisites ; \
200 rm -f $(DOC_MODULE)-sections.txt ; \
201 rm -rf tmpl/*.sgml ; \
205 # thomas: make docs parallel installable; devhelp requires majorminor too
207 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
208 (installfiles=`echo ./html/*.html`; \
209 if test "$$installfiles" = './html/*.html'; \
210 then echo '-- Nothing to install' ; \
212 for i in $$installfiles; do \
213 echo '-- Installing '$$i ; \
214 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
216 pngfiles=`echo ./html/*.png`; \
217 if test "$$pngfiles" != './html/*.png'; then \
218 for i in $$pngfiles; do \
219 echo '-- Installing '$$i ; \
220 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
223 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
224 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
225 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
226 echo '-- Installing $(srcdir)/html/index.sgml' ; \
227 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
228 if test -e $(srcdir)/html/style.css; then \
229 echo '-- Installing $(srcdir)/html/style.css' ; \
230 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
234 (installfiles=`echo ./html/*.html`; \
235 if test "$$installfiles" = './html/*.html'; \
236 then echo '-- Nothing to uninstall' ; \
238 for i in $$installfiles; do \
239 rmfile=`basename $$i` ; \
240 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
241 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
243 pngfiles=`echo ./html/*.png`; \
244 if test "$$pngfiles" != './html/*.png'; then \
245 for i in $$pngfiles; do \
246 rmfile=`basename $$i` ; \
247 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
248 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
251 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
252 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
253 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
254 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
255 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
256 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
257 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
260 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
263 # Require gtk-doc when making dist
269 @echo "*** gtk-doc must be installed and enabled in order to make dist"
273 dist-hook: dist-check-gtkdoc dist-hook-local
274 mkdir $(distdir)/tmpl
276 mkdir $(distdir)/html
277 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
278 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
279 -cp $(srcdir)/html/index.sgml $(distdir)/html
280 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
281 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
283 images=$(HTML_IMAGES) ; \
284 for i in "" $$images ; do \
285 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
288 .PHONY : dist-hook-local