docs/libs/Makefile.am: Change sinclude to include
[platform/upstream/gstreamer.git] / docs / gst / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # The name of the module, e.g. 'glib'.
4 # DOC_MODULE=gstreamer-@GST_MAJORMINOR@
5 DOC_MODULE=gstreamer
6
7 # for upload.mak
8 DOC=gstreamer
9 FORMATS=html
10 html: html-build.stamp
11 include $(srcdir)/../upload.mak
12
13 # generated basefiles
14 #basefiles = \
15 #               gstreamer-@GST_MAJORMINOR@.types \
16 #               gstreamer-@GST_MAJORMINOR@-sections.txt \
17 #               gstreamer-@GST_MAJORMINOR@-docs.sgml
18
19 # ugly hack to make -unused.sgml work
20 #unused-build.stamp:
21 #       BUILDDIR=`pwd` && \
22 #       cd $(srcdir)/tmpl && \
23 #       ln -sf gstreamer-unused.sgml \
24 #               $$BUILDDIR/tmpl/gstreamer-@GST_MAJORMINOR@-unused.sgml
25 #       touch unused-build.stamp
26
27 # these rules are added to create parallel docs using GST_MAJORMINOR
28 #$(basefiles): gstreamer-@GST_MAJORMINOR@%: gstreamer%
29 #       cp $< $@
30
31 #CLEANFILES = $(basefiles)
32
33 # The top-level SGML file. Change it if you want.
34 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
35
36 # The directory containing the source code. Relative to $(top_srcdir).
37 # gtk-doc will search all .c & .h files beneath here for inline comments
38 # documenting functions and macros.
39 DOC_SOURCE_DIR=$(top_srcdir)/gst
40
41 # Extra options to supply to gtkdoc-scan.
42 SCAN_OPTIONS=
43
44 # Extra options to supply to gtkdoc-mkdb.
45 MKDB_OPTIONS=--sgml-mode --ignore-files=parse
46
47 # Extra options to supply to gtkdoc-fixref.
48 FIXXREF_OPTIONS=
49
50 # Used for dependencies.
51 HFILE_GLOB=$(DOC_SOURCE_DIR)/*.h
52 CFILE_GLOB=$(DOC_SOURCE_DIR)/*.c
53
54 # this is a wingo addition
55 # thomasvs: another nice wingo addition would be an explanation on why
56 # this is useful ;)
57
58 #SCANOBJ_DEPS = $(top_builddir)/gst/elements/libgstelements.la \
59 #       $(top_builddir)/gst/schedulers/libgstbasicomegascheduler.la
60
61 # Header files to ignore when scanning. Use base file name, no paths
62 IGNORE_HFILES= \
63         gettext.h \
64         gst-i18n-lib.h \
65         gst-i18n-app.h \
66         gst_private.h \
67         gstatomic_impl.h \
68         gstdata_private.h \
69         gstarch.h \
70         cothreads.h \
71         cothreads_compat.h \
72         gthread-cothreads.h \
73         types.h \
74         grammar.tab.h \
75         gstmarshal.h \
76         elements/gstaggregator.h \
77         elements/gstbufferstore.h \
78         elements/gstfakesink.h \
79         elements/gstfakesrc.h \
80         elements/gstfdsink.h \
81         elements/gstfdsrc.h \
82         elements/gstfilesink.h \
83         elements/gstfilesrc.h \
84         elements/gstidentity.h \
85         elements/gstmd5sink.h \
86         elements/gstmultifilesrc.h \
87         elements/gstpipefilter.h \
88         elements/gstshaper.h \
89         elements/gststatistics.h \
90         elements/gsttee.h \
91         elements/gsttypefind.h
92
93 # Images to copy into HTML directory.
94 HTML_IMAGES =
95
96 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
97 content_files =
98
99 # Other files to distribute.
100 extra_files =
101
102 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
103 # contains GtkObjects/GObjects and you want to document signals and properties.
104 GTKDOC_CFLAGS = $(GST_CFLAGS) -I$(top_builddir)
105 GTKDOC_LIBS = $(GST_LIBS) $(SCANOBJ_DEPS)
106
107 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
108 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
109
110 # If you need to override some of the declarations, place them in this file
111 # and uncomment this line.
112 #DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt
113
114
115
116 ###########################################################################
117 # Everything below here is generic and you shouldn't need to change it.
118 ###########################################################################
119 # thomas: except of course that we did
120
121 # thomas: copied from glib-2
122 # We set GPATH here; this gives us semantics for GNU make
123 # which are more like other make's VPATH, when it comes to
124 # whether a source that is a target of one rule is then
125 # searched for in VPATH/GPATH.
126 #
127 GPATH = $(srcdir)
128
129 # thomas: make docs parallel installable
130 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
131
132 EXTRA_DIST =                            \
133         $(content_files)                \
134         $(extra_files)                  \
135         $(HTML_IMAGES)                  \
136         $(DOC_MAIN_SGML_FILE)           \
137         $(DOC_MODULE).types             \
138         $(DOC_MODULE)-sections.txt
139
140 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
141            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
142
143 SCANOBJ_FILES =                 \
144         $(DOC_MODULE).args      \
145         $(DOC_MODULE).hierarchy \
146         $(DOC_MODULE).interfaces \
147         $(DOC_MODULE).prerequisites \
148         $(DOC_MODULE)-scan.o    \
149         $(DOC_MODULE).signals
150
151 CLEANFILES =  $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
152
153 if HAVE_GTK_DOC
154 all-local: html-build.stamp
155
156 #### scan ####
157
158 # in the case of non-srcdir builds, the built gst directory gets added
159 # to gtk-doc scanning; but only then, to avoid duplicates
160 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
161         @echo '*** Scanning header files ***'
162         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
163             if test x"$(srcdir)" != x. ; then \
164                 cp $(srcdir)/$(DOC_MODULE).types . ; \
165                 chmod u+w $(DOC_MODULE).types ; \
166             fi ; \
167             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" $(GTK_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" --module=$(DOC_MODULE) ; \
168         else \
169             cd $(srcdir) ; \
170             for i in $(SCANOBJ_FILES) ; do \
171                test -f $$i || touch $$i ; \
172             done \
173         fi
174         if test "x$(top_srcdir)" != "x$(top_builddir)"; \
175         then \
176           export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
177         fi; \
178         gtkdoc-scan \
179                 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
180                 --module=$(DOC_MODULE) \
181                 --source-dir=$(DOC_SOURCE_DIR) \
182                 $$BUILT_OPTIONS \
183                 --ignore-headers="$(IGNORE_HFILES)"
184         touch scan-build.stamp
185
186 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
187         @true
188
189 #### templates ####
190
191 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
192         @echo '*** Rebuilding template files ***'
193         if test x"$(srcdir)" != x. ; then \
194             cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
195             touch $(DOC_MODULE)-decl.txt ; \
196         fi
197         gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
198         @if grep "WARNING:" tmpl-build.log > /dev/null; then exit 1; fi
199         rm -f tmpl-build.log
200         touch tmpl-build.stamp
201
202 tmpl.stamp: tmpl-build.stamp
203         @true
204
205 #### xml ####
206
207 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
208         @echo '*** Building XML ***'
209         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
210         @if grep "WARNING:" sgml-build.log > /dev/null; then exit 1; fi
211         rm sgml-build.log
212         touch sgml-build.stamp
213
214 sgml.stamp: sgml-build.stamp
215         @true
216
217 #### html ####
218
219 # FIXME: setting LANG=C is a hack to work with gtk-doc < 1.1, because
220 # that forces a non-utf8 locale.  gtk-doc >= 1.1 solves this by calling
221 # use bytes; in gtkdoc-fixxref
222 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
223         @echo '*** Building HTML ***'
224         test -d html || mkdir html
225         cd html && gtkdoc-mkhtml $(DOC_MODULE) $(srcdir)/../$(DOC_MAIN_SGML_FILE)
226         test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
227             if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
228         @echo '-- Fixing Crossreferences' 
229         LANG=C && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
230         touch html-build.stamp
231 endif
232
233 clean-local:
234         rm -f *~ *.bak
235         rm -rf xml html
236         rm -rf .libs
237
238 maintainer-clean-local: clean
239         cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
240
241 # company: don't delete .sgml and -sections.txt as they're in CVS
242 # FIXME : thomas added all sgml files and some other things to make
243 # make distcheck work
244 distclean-local: clean
245         rm -rf $(DOC_MODULE)-decl-list.txt
246         rm -rf $(DOC_MODULE)-decl.txt
247         rm -rf $(DOC_MODULE)-undocumented.txt
248         rm -rf $(DOC_MODULE)-unused.txt
249         rm -rf tmpl/*.sgml.bak
250         rm -f $(DOC_MODULE).hierarchy
251         rm -f *.stamp || true
252         if test x"$(srcdir)" != x. ; then \
253             rm -f $(DOC_MODULE)-docs.sgml ; \
254             rm -f $(DOC_MODULE).types ; \
255             rm -f $(DOC_MODULE).interfaces ; \
256             rm -f $(DOC_MODULE).prerequisites ; \
257             rm -f $(DOC_MODULE)-sections.txt ; \
258             rm -rf tmpl/*.sgml ; \
259         fi
260         rm -rf *.o
261
262 # thomas: make docs parallel installable; devhelp requires majorminor too
263 if DOC_HTML
264 install-data-local:
265         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR) 
266         (installfiles=`echo ./html/*.html`; \
267         if test "$$installfiles" = './html/*.html'; \
268         then echo '-- Nothing to install' ; \
269         else \
270           for i in $$installfiles; do \
271             echo '-- Installing '$$i ; \
272             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
273           done; \
274           pngfiles=`echo ./html/*.png`; \
275           if test "$$pngfiles" != './html/*.png'; then \
276             for i in $$pngfiles; do \
277               echo '-- Installing '$$i ; \
278               $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
279             done; \
280           fi; \
281           echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
282           $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
283             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
284           echo '-- Installing $(srcdir)/html/index.sgml' ; \
285           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
286         fi) 
287 uninstall-local:
288         (installfiles=`echo ./html/*.html`; \
289         if test "$$installfiles" = './html/*.html'; \
290         then echo '-- Nothing to uninstall' ; \
291         else \
292           for i in $$installfiles; do \
293             rmfile=`basename $$i` ; \
294             echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
295             rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
296           done; \
297           pngfiles=`echo ./html/*.png`; \
298           if test "$$pngfiles" != './html/*.png'; then \
299             for i in $$pngfiles; do \
300               rmfile=`basename $$i` ; \
301               echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
302               rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
303             done; \
304           fi; \
305           echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
306           rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
307           echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
308           rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
309         fi) 
310         if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR); fi
311 else
312 install-data-local:
313 uninstall-local:
314 all-local:
315 endif
316
317 #
318 # Require gtk-doc when making dist
319 #
320 if HAVE_GTK_DOC
321 dist-check-gtkdoc:
322 else
323 dist-check-gtkdoc:
324         @echo "*** gtk-doc must be installed and enabled in order to make dist"
325         @false
326 endif
327
328 dist-hook: dist-check-gtkdoc dist-hook-local
329         mkdir $(distdir)/tmpl
330         mkdir $(distdir)/xml
331         mkdir $(distdir)/html
332         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
333         -cp $(srcdir)/sgml/*.xml $(distdir)/xml
334         -cp $(srcdir)/html/index.sgml $(distdir)/html
335         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
336
337         images=$(HTML_IMAGES) ;               \
338         for i in "" $$images ; do                     \
339           if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
340         done
341
342 .PHONY : dist-hook-local