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