common/: only inspect plugins for this given package require gst-python 0.9
[platform/upstream/gst-common.git] / gtk-doc-plugins.mak
1 ###########################################################################
2 # Everything below here is generic and you shouldn't need to change it.
3 ###########################################################################
4 # thomas: except of course that we did
5
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.
11 #
12 GPATH = $(srcdir)
13
14 # thomas: make docs parallel installable
15 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
16
17 EXTRA_DIST =                            \
18         $(content_files)                \
19         $(extra_files)                  \
20         $(HTML_IMAGES)                  \
21         $(DOC_MAIN_SGML_FILE)           \
22         $(DOC_OVERRIDES)                \
23         $(DOC_MODULE)-sections.txt
24
25 # we don't add inspect-build.stamp here since this is run manually
26 # by docs maintainers and result is commited to CVS
27 DOC_STAMPS =                            \
28         scan-build.stamp                \
29         tmpl-build.stamp                \
30         sgml-build.stamp                \
31         html-build.stamp                \
32         $(srcdir)/tmpl.stamp            \
33         $(srcdir)/sgml.stamp            \
34         $(srcdir)/html.stamp
35
36 SCANOBJ_FILES =                         \
37         $(DOC_MODULE).args              \
38         $(DOC_MODULE).hierarchy         \
39         $(DOC_MODULE).interfaces        \
40         $(DOC_MODULE).prerequisites     \
41         .libs/$(DOC_MODULE)-scan.o      \
42         $(DOC_MODULE).signals
43
44 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
45
46 if ENABLE_GTK_DOC
47 all-local: html-build.stamp
48
49 #### scan ####
50
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 ;                         \
58             fi ;                                                        \
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)";                 \
66         then                                                            \
67           export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst";      \
68         fi;                                                             \
69         gtkdoc-scan                                                     \
70                 $(SCAN_OPTIONS) $(EXTRA_HFILES)                         \
71                 --module=$(DOC_MODULE)                                  \
72                 $$BUILT_OPTIONS                                         \
73                 --ignore-headers="$(IGNORE_HFILES)"
74         touch scan-build.stamp
75
76 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
77         @true
78
79 #### templates ####
80
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 ; \
87         fi
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 \
91             true; fi # exit 1; fi
92         rm -f tmpl-build.log
93         touch tmpl-build.stamp
94
95 tmpl.stamp: tmpl-build.stamp
96         @true
97
98 #### inspect stuff ####
99 # this is stuff that should be built/updated manually by people that work
100 # on docs
101
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)
108
109
110 # update the element and plugin XML descriptions; store in inspect/
111 inspect:
112         mkdir inspect
113
114 inspect-update:
115         rm inspect-build.stamp
116         make inspect-build.stamp
117
118 # FIXME: inspect.timestamp should be written to by gst-xmlinspect.py
119 # IFF the output changed; see gtkdoc-mktmpl
120 inspect-build.stamp: inspect
121         $(INSPECT_ENVIRONMENT) $(PYTHON) \
122                 $(top_srcdir)/common/gst-xmlinspect.py $(PACKAGE) inspect
123         $(INSPECT_ENVIRONMENT) $(PYTHON) \
124                 $(top_srcdir)/common/mangle-tmpl.py tmpl
125         echo -n "timestamp" > inspect.stamp
126         touch inspect-build.stamp
127
128 inspect.stamp: inspect-build.stamp
129         @true
130
131 #### xml ####
132
133 ### FIXME: make this error out again when docs are fixed for 0.9
134 # first convert inspect/*.xml to xml
135 sgml-build.stamp: tmpl.stamp inspect.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl
136         @echo '*** Building XML ***'
137         @-mkdir -p xml
138         @for a in inspect/*.xml; do \
139             xsltproc --stringparam module $(MODULE) \
140                 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
141         gtkdoc-mkdb \
142                 --module=$(DOC_MODULE) \
143                 --source-dir=$(DOC_SOURCE_DIR) \
144                 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
145                 --output-format=xml \
146                 --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \
147                 $(MKDB_OPTIONS) \
148                 | tee sgml-build.log
149         @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
150         cp ../version.entities xml
151         rm sgml-build.log
152         touch sgml-build.stamp
153
154 sgml.stamp: sgml-build.stamp
155         @true
156
157 #### html ####
158
159 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(top_srcdir)/common/plugins.xsl
160         @echo '*** Building HTML ***'
161         if test -d html; then rm -rf html; fi
162         mkdir html
163         cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
164         @for f in $(content_files); do cp $(srcdir)/$$f html; done
165         cp -pr xml html
166         cp ../version.entities html
167         cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
168         rm -f html/$(DOC_MAIN_SGML_FILE)
169         rm -rf html/xml
170         rm -f html/version.entities
171         test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
172             if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
173         @echo '-- Fixing Crossreferences' 
174         gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
175         touch html-build.stamp
176 else
177 all-local:
178 endif
179
180 clean-local:
181         rm -f *~ *.bak
182         rm -rf xml html
183         rm -rf .libs
184
185 maintainer-clean-local: clean
186         cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
187
188 # company: don't delete .sgml and -sections.txt as they're in CVS
189 # FIXME : thomas added all sgml files and some other things to make
190 # make distcheck work
191 distclean-local: clean
192         rm -f $(DOC_MODULE)-decl-list.txt
193         rm -f $(DOC_MODULE)-decl.txt
194         rm -f $(DOC_MODULE)-undocumented.txt
195         rm -f $(DOC_MODULE)-unused.txt
196         rm -rf tmpl/*.sgml.bak
197         rm -f $(DOC_MODULE).hierarchy
198         rm -f *.stamp || true
199         if test x"$(srcdir)" != x. ; then \
200             rm -f $(DOC_MODULE)-docs.sgml ; \
201             rm -f $(DOC_MODULE).types ; \
202             rm -f $(DOC_MODULE).interfaces ; \
203             rm -f $(DOC_MODULE)-overrides.txt ; \
204             rm -f $(DOC_MODULE).prerequisites ; \
205             rm -f $(DOC_MODULE)-sections.txt ; \
206             rm -rf tmpl/*.sgml ; \
207         fi
208         rm -rf *.o
209
210 # thomas: make docs parallel installable; devhelp requires majorminor too
211 install-data-local:
212         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR) 
213         (installfiles=`echo ./html/*.html`; \
214         if test "$$installfiles" = './html/*.html'; \
215         then echo '-- Nothing to install' ; \
216         else \
217           for i in $$installfiles; do \
218             echo '-- Installing '$$i ; \
219             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
220           done; \
221           pngfiles=`echo ./html/*.png`; \
222           if test "$$pngfiles" != './html/*.png'; then \
223             for i in $$pngfiles; do \
224               echo '-- Installing '$$i ; \
225               $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
226             done; \
227           fi; \
228           echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
229           $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
230             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
231           echo '-- Installing $(srcdir)/html/index.sgml' ; \
232           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
233                 if test -e $(srcdir)/html/style.css; then \
234                         echo '-- Installing $(srcdir)/html/style.css' ; \
235                         $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
236                 fi; \
237         fi) 
238 uninstall-local:
239         (installfiles=`echo ./html/*.html`; \
240         if test "$$installfiles" = './html/*.html'; \
241         then echo '-- Nothing to uninstall' ; \
242         else \
243           for i in $$installfiles; do \
244             rmfile=`basename $$i` ; \
245             echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
246             rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
247           done; \
248           pngfiles=`echo ./html/*.png`; \
249           if test "$$pngfiles" != './html/*.png'; then \
250             for i in $$pngfiles; do \
251               rmfile=`basename $$i` ; \
252               echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
253               rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
254             done; \
255           fi; \
256           echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
257           rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
258           echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
259           rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
260                 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
261                         echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
262                         rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
263                 fi; \
264         fi) 
265         if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
266
267 #
268 # Require gtk-doc when making dist
269 #
270 if ENABLE_GTK_DOC
271 dist-check-gtkdoc:
272 else
273 dist-check-gtkdoc:
274         @echo "*** gtk-doc must be installed and enabled in order to make dist"
275         @false
276 endif
277
278 dist-hook: dist-check-gtkdoc dist-hook-local
279         mkdir $(distdir)/tmpl
280         mkdir $(distdir)/xml
281         mkdir $(distdir)/html
282         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
283         -cp $(srcdir)/sgml/*.xml $(distdir)/xml
284         -cp $(srcdir)/html/index.sgml $(distdir)/html
285         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
286         -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
287
288         images=$(HTML_IMAGES) ;               \
289         for i in "" $$images ; do                     \
290           if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
291         done
292
293 .PHONY : dist-hook-local