converting to xml as intermediary step to fix devhelp generation assorted doc build...
[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 # generated basefiles
8 #basefiles = \
9 #               gstreamer-@GST_MAJORMINOR@.types \
10 #               gstreamer-@GST_MAJORMINOR@-sections.txt \
11 #               gstreamer-@GST_MAJORMINOR@-docs.sgml
12
13 # ugly hack to make -unused.sgml work
14 #unused-build.stamp:
15 #       BUILDDIR=`pwd` && \
16 #       cd $(srcdir)/tmpl && \
17 #       ln -sf gstreamer-unused.sgml \
18 #               $$BUILDDIR/tmpl/gstreamer-@GST_MAJORMINOR@-unused.sgml
19 #       touch unused-build.stamp
20
21 # these rules are added to create parallel docs using GST_MAJORMINOR
22 #$(basefiles): gstreamer-@GST_MAJORMINOR@%: gstreamer%
23 #       cp $< $@
24
25 #CLEANFILES = $(basefiles)
26
27 # The top-level SGML file. Change it if you want.
28 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
29
30 # The directory containing the source code. Relative to $(top_srcdir).
31 # gtk-doc will search all .c & .h files beneath here for inline comments
32 # documenting functions and macros.
33 DOC_SOURCE_DIR=$(top_srcdir)/gst
34
35 # Extra options to supply to gtkdoc-scan.
36 SCAN_OPTIONS=
37
38 # FIXME :
39 # there's something wrong with gstreamer-sections.txt not being in the dist
40 # maybe it doesn't resolve; we're adding it below for now
41 #EXTRA_DIST = gstreamer.types.in gstreamer.hierarchy $(DOC_MODULE)-sections.txt gstreamer-sections.txt $(DOC_MAIN_SGML_FILE)
42
43 # Extra options to supply to gtkdoc-mkdb.
44 MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files=trio
45
46 # Extra options to supply to gtkdoc-fixref.
47 FIXXREF_OPTIONS=
48
49 # Used for dependencies.
50 HFILE_GLOB=$(DOC_SOURCE_DIR)/*.h
51 CFILE_GLOB=$(DOC_SOURCE_DIR)/*.c
52
53 # this is a wingo addition
54 # thomasvs: another nice wingo addition would be an explanation on why
55 # this is useful ;)
56
57 #SCANOBJ_DEPS = $(top_builddir)/gst/elements/libgstelements.la \
58 #       $(top_builddir)/gst/schedulers/libgstbasicomegascheduler.la
59
60 # Header files to ignore when scanning.
61 IGNORE_HFILES=
62
63 # Images to copy into HTML directory.
64 HTML_IMAGES =
65
66 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
67 content_files =
68
69 # Other files to distribute.
70 extra_files =
71
72 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
73 # contains GtkObjects/GObjects and you want to document signals and properties.
74 GTKDOC_CFLAGS = $(GST_CFLAGS)
75 GTKDOC_LIBS = $(GST_LIBS) $(SCANOBJ_DEPS)
76
77 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
78 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
79
80 # If you need to override some of the declarations, place them in this file
81 # and uncomment this line.
82 #DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt
83
84
85
86 ###########################################################################
87 # Everything below here is generic and you shouldn't need to change it.
88 ###########################################################################
89 # thomas: except of course that we did
90
91 # thomas: copied from glib-2
92 # We set GPATH here; this gives us semantics for GNU make
93 # which are more like other make's VPATH, when it comes to
94 # whether a source that is a target of one rule is then
95 # searched for in VPATH/GPATH.
96 #
97 GPATH = $(srcdir)
98
99 # thomas: make docs parallel installable
100 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
101
102 EXTRA_DIST =                            \
103         $(content_files)                \
104         $(extra_files)                  \
105         $(HTML_IMAGES)                  \
106         $(DOC_MAIN_SGML_FILE)           \
107         $(DOC_MODULE).types             \
108         $(DOC_MODULE)-sections.txt
109
110 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
111            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
112
113 SCANOBJ_FILES =                 \
114         $(DOC_MODULE).args      \
115         $(DOC_MODULE).hierarchy \
116         $(DOC_MODULE).signals
117
118 if HAVE_GTK_DOC
119 all-local: html-build.stamp
120
121 #### scan ####
122
123
124 # wingo addition
125 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
126         @echo '*** Scanning header files ***'
127         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
128             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" $(GTK_DOC_SCANOBJ) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
129         else \
130             cd $(srcdir) ; \
131             for i in $(SCANOBJ_FILES) ; do \
132                test -f $$i || touch $$i ; \
133             done \
134         fi
135         cd $(srcdir) && \
136           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
137         touch scan-build.stamp
138
139 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
140         @true
141
142 #### templates ####
143
144 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
145         @echo '*** Rebuilding template files ***'
146         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
147         touch tmpl-build.stamp
148
149 tmpl.stamp: tmpl-build.stamp
150         @true
151
152 #### sgml ####
153
154 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
155         @echo '*** Building SGML ***'
156         cd $(srcdir) && \
157         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
158         touch sgml-build.stamp
159
160 sgml.stamp: sgml-build.stamp
161         @true
162
163 #### html ####
164
165 # FIXME: setting LANG=C is a hack to work with gtk-doc < 1.1, because
166 # that forces a non-utf8 locale.  gtk-doc >= 1.1 solves this by calling
167 # use bytes; in gtkdoc-fixxref
168 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
169         @echo '*** Building HTML ***'
170         test -d $(srcdir)/html || mkdir $(srcdir)/html
171         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
172         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
173         @echo '-- Fixing Crossreferences' 
174         cd $(srcdir) && LANG=C && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
175         touch html-build.stamp
176 endif
177
178 clean-local:
179         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
180         rm -rf xml html
181
182 maintainer-clean-local: clean
183         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
184
185 # FIXME : thomas added all sgml files and some other things to make
186 # make distcheck work
187 distclean-local: clean
188         rm -rf $(DOC_MODULE)-decl-list.txt
189         rm -rf $(DOC_MODULE)-*.txt
190         rm -rf tmpl/*.sgml
191         rm -f $(DOC_MODULE).hierarchy
192         rm -f *.stamp || true
193
194 # thomas: make docs parallel installable; devhelp requires majorminor too
195 install-data-local:
196         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
197         (installfiles=`echo $(srcdir)/html/*.html $(srcdir)/html/*.png`; \
198         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
199         then echo '-- Nothing to install' ; \
200         else \
201           for i in $$installfiles; do \
202             echo '-- Installing '$$i ; \
203             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
204           done; \
205           echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
206           $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
207             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
208           echo '-- Installing $(srcdir)/html/index.sgml' ; \
209           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
210         fi)
211
212 #
213 # Require gtk-doc when making dist
214 #
215 if HAVE_GTK_DOC
216 dist-check-gtkdoc:
217 else
218 dist-check-gtkdoc:
219         @echo "*** gtk-doc must be installed and enabled in order to make dist"
220         @false
221 endif
222
223 dist-hook: dist-check-gtkdoc dist-hook-local
224         mkdir $(distdir)/tmpl
225         mkdir $(distdir)/xml
226         mkdir $(distdir)/html
227         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
228         -cp $(srcdir)/sgml/*.xml $(distdir)/xml
229         -cp $(srcdir)/html/index.sgml $(distdir)/html
230         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
231
232         images=$(HTML_IMAGES) ;               \
233         for i in $$images ; do                \
234           cp $(srcdir)/$$i $(distdir)/html ;  \
235         done
236
237 .PHONY : dist-hook-local