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 echo -n "timestamp" > inspect.stamp
120 touch inspect-build.stamp
122 inspect.stamp: inspect-build.stamp
127 ### FIXME: make this error out again when docs are fixed for 0.9
128 # first convert inspect/*.xml to xml
129 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB)
130 @echo '*** Building XML ***'
132 @for a in inspect/*.xml; do \
133 xsltproc $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
135 --module=$(DOC_MODULE) \
136 --source-dir=$(DOC_SOURCE_DIR) \
137 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
138 --output-format=xml \
139 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
142 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
143 cp ../version.entities xml
145 touch sgml-build.stamp
147 sgml.stamp: sgml-build.stamp
152 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
153 @echo '*** Building HTML ***'
154 if test -d html; then rm -rf html; fi
156 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
157 @for f in $(content_files); do cp $(srcdir)/$$f html; done
159 cp ../version.entities html
160 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
161 rm -f html/$(DOC_MAIN_SGML_FILE)
163 rm -f html/version.entities
164 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
165 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
166 @echo '-- Fixing Crossreferences'
167 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
168 touch html-build.stamp
178 maintainer-clean-local: clean
179 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
181 # company: don't delete .sgml and -sections.txt as they're in CVS
182 # FIXME : thomas added all sgml files and some other things to make
183 # make distcheck work
184 distclean-local: clean
185 rm -f $(DOC_MODULE)-decl-list.txt
186 rm -f $(DOC_MODULE)-decl.txt
187 rm -f $(DOC_MODULE)-undocumented.txt
188 rm -f $(DOC_MODULE)-unused.txt
189 rm -rf tmpl/*.sgml.bak
190 rm -f $(DOC_MODULE).hierarchy
191 rm -f *.stamp || true
192 if test x"$(srcdir)" != x. ; then \
193 rm -f $(DOC_MODULE)-docs.sgml ; \
194 rm -f $(DOC_MODULE).types ; \
195 rm -f $(DOC_MODULE).interfaces ; \
196 rm -f $(DOC_MODULE)-overrides.txt ; \
197 rm -f $(DOC_MODULE).prerequisites ; \
198 rm -f $(DOC_MODULE)-sections.txt ; \
199 rm -rf tmpl/*.sgml ; \
203 # thomas: make docs parallel installable; devhelp requires majorminor too
205 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
206 (installfiles=`echo ./html/*.html`; \
207 if test "$$installfiles" = './html/*.html'; \
208 then echo '-- Nothing to install' ; \
210 for i in $$installfiles; do \
211 echo '-- Installing '$$i ; \
212 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
214 pngfiles=`echo ./html/*.png`; \
215 if test "$$pngfiles" != './html/*.png'; then \
216 for i in $$pngfiles; do \
217 echo '-- Installing '$$i ; \
218 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
221 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
222 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
223 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
224 echo '-- Installing $(srcdir)/html/index.sgml' ; \
225 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
226 if test -e $(srcdir)/html/style.css; then \
227 echo '-- Installing $(srcdir)/html/style.css' ; \
228 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
232 (installfiles=`echo ./html/*.html`; \
233 if test "$$installfiles" = './html/*.html'; \
234 then echo '-- Nothing to uninstall' ; \
236 for i in $$installfiles; do \
237 rmfile=`basename $$i` ; \
238 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
239 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
241 pngfiles=`echo ./html/*.png`; \
242 if test "$$pngfiles" != './html/*.png'; then \
243 for i in $$pngfiles; do \
244 rmfile=`basename $$i` ; \
245 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
246 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
249 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
250 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
251 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
252 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
253 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
254 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
255 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
258 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
261 # Require gtk-doc when making dist
267 @echo "*** gtk-doc must be installed and enabled in order to make dist"
271 dist-hook: dist-check-gtkdoc dist-hook-local
272 mkdir $(distdir)/tmpl
274 mkdir $(distdir)/html
275 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
276 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
277 -cp $(srcdir)/html/index.sgml $(distdir)/html
278 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
279 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
281 images=$(HTML_IMAGES) ; \
282 for i in "" $$images ; do \
283 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
286 .PHONY : dist-hook-local