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
31 $(srcdir)/tmpl.stamp \
32 $(srcdir)/sgml.stamp \
37 $(DOC_MODULE).hierarchy \
38 $(DOC_MODULE).interfaces \
39 $(DOC_MODULE).prerequisites \
40 .libs/$(DOC_MODULE)-scan.o \
43 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
46 all-local: html-build.stamp
50 # in the case of non-srcdir builds, the built gst directory gets added
51 # to gtk-doc scanning; but only then, to avoid duplicates
52 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
53 @echo '*** Scanning header files ***'
54 if test x"$(srcdir)" != x. ; then \
55 cp $(srcdir)/$(DOC_MODULE).types . ; \
56 chmod u+w $(DOC_MODULE).types ; \
58 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
59 GST_PLUGIN_PATH_ONLY=1 \
60 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
61 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
62 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
63 --module=$(DOC_MODULE) ; \
64 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
66 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
69 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
70 --module=$(DOC_MODULE) \
72 --ignore-headers="$(IGNORE_HFILES)"
73 touch scan-build.stamp
75 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
80 ### FIXME: make this error out again when docs are fixed for 0.9
81 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
82 @echo '*** Rebuilding template files ***'
83 if test x"$(srcdir)" != x. ; then \
84 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
85 touch $(DOC_MODULE)-decl.txt ; \
87 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
88 @cat $(DOC_MODULE)-unused.txt
89 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
92 touch tmpl-build.stamp
94 tmpl.stamp: tmpl-build.stamp
97 #### inspect stuff ####
98 # this is stuff that should be built/updated manually by people that work
101 # only look at the plugins in this module when building inspect .xml stuff
102 INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
103 INSPECT_ENVIRONMENT=\
104 GST_PLUGIN_PATH_ONLY=yes \
105 GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext \
106 GST_REGISTRY=$(INSPECT_REGISTRY)
109 # update the element and plugin XML descriptions; store in inspect/
113 inspect-build.stamp: inspect
114 $(INSPECT_ENVIRONMENT) $(PYTHON) \
115 $(top_srcdir)/common/gst-xmlinspect.py inspect
116 touch inspect-build.stamp
118 inspect.stamp: inspect-build.stamp
123 ### FIXME: make this error out again when docs are fixed for 0.9
124 # first convert inspect/*.xml to xml
125 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB)
126 @echo '*** Building XML ***'
128 @for a in inspect/*.xml; do \
129 xsltproc $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
131 --module=$(DOC_MODULE) \
132 --source-dir=$(DOC_SOURCE_DIR) \
133 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
134 --output-format=xml \
135 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
138 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
139 cp ../version.entities xml
141 touch sgml-build.stamp
143 sgml.stamp: sgml-build.stamp
148 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
149 @echo '*** Building HTML ***'
150 if test -d html; then rm -rf html; fi
152 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
153 @for f in $(content_files); do cp $(srcdir)/$$f html; done
155 cp ../version.entities html
156 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
157 rm -f html/$(DOC_MAIN_SGML_FILE)
159 rm -f html/version.entities
160 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
161 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
162 @echo '-- Fixing Crossreferences'
163 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
164 touch html-build.stamp
174 maintainer-clean-local: clean
175 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
177 # company: don't delete .sgml and -sections.txt as they're in CVS
178 # FIXME : thomas added all sgml files and some other things to make
179 # make distcheck work
180 distclean-local: clean
181 rm -f $(DOC_MODULE)-decl-list.txt
182 rm -f $(DOC_MODULE)-decl.txt
183 rm -f $(DOC_MODULE)-undocumented.txt
184 rm -f $(DOC_MODULE)-unused.txt
185 rm -rf tmpl/*.sgml.bak
186 rm -f $(DOC_MODULE).hierarchy
187 rm -f *.stamp || true
188 if test x"$(srcdir)" != x. ; then \
189 rm -f $(DOC_MODULE)-docs.sgml ; \
190 rm -f $(DOC_MODULE).types ; \
191 rm -f $(DOC_MODULE).interfaces ; \
192 rm -f $(DOC_MODULE)-overrides.txt ; \
193 rm -f $(DOC_MODULE).prerequisites ; \
194 rm -f $(DOC_MODULE)-sections.txt ; \
195 rm -rf tmpl/*.sgml ; \
199 # thomas: make docs parallel installable; devhelp requires majorminor too
201 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
202 (installfiles=`echo ./html/*.html`; \
203 if test "$$installfiles" = './html/*.html'; \
204 then echo '-- Nothing to install' ; \
206 for i in $$installfiles; do \
207 echo '-- Installing '$$i ; \
208 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
210 pngfiles=`echo ./html/*.png`; \
211 if test "$$pngfiles" != './html/*.png'; then \
212 for i in $$pngfiles; do \
213 echo '-- Installing '$$i ; \
214 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
217 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
218 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
219 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
220 echo '-- Installing $(srcdir)/html/index.sgml' ; \
221 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
222 if test -e $(srcdir)/html/style.css; then \
223 echo '-- Installing $(srcdir)/html/style.css' ; \
224 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
228 (installfiles=`echo ./html/*.html`; \
229 if test "$$installfiles" = './html/*.html'; \
230 then echo '-- Nothing to uninstall' ; \
232 for i in $$installfiles; do \
233 rmfile=`basename $$i` ; \
234 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
235 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
237 pngfiles=`echo ./html/*.png`; \
238 if test "$$pngfiles" != './html/*.png'; then \
239 for i in $$pngfiles; do \
240 rmfile=`basename $$i` ; \
241 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
242 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
245 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
246 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
247 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
248 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
249 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
250 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
251 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
254 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
257 # Require gtk-doc when making dist
263 @echo "*** gtk-doc must be installed and enabled in order to make dist"
267 dist-hook: dist-check-gtkdoc dist-hook-local
268 mkdir $(distdir)/tmpl
270 mkdir $(distdir)/html
271 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
272 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
273 -cp $(srcdir)/html/index.sgml $(distdir)/html
274 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
275 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
277 images=$(HTML_IMAGES) ; \
278 for i in "" $$images ; do \
279 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
282 .PHONY : dist-hook-local