converting to xml as intermediary step to fix devhelp generation assorted doc build...
[platform/upstream/gstreamer.git] / docs / libs / 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-libs-@GST_MAJORMINOR@
5 DOC_MODULE=gstreamer-libs
6
7 # generated basefiles
8 #basefiles = \
9 ##              $(DOC_MODULE).types \
10 #               $(DOC_MODULE)-sections.txt \
11 #               $(DOC_MODULE)-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-libs-unused.sgml \
18 #               $$BUILDDIR/tmpl/gstreamer-libs-@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-libs-@GST_MAJORMINOR@%: gstreamer-libs%
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)/libs/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=--extra-dir=../gst/html
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 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
100
101 EXTRA_DIST =                            \
102         $(content_files)                \
103         $(extra_files)                  \
104         $(HTML_IMAGES)                  \
105         $(DOC_MAIN_SGML_FILE)           \
106         $(DOC_MODULE).types             \
107         $(DOC_MODULE)-sections.txt
108
109 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
110            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
111
112 SCANOBJ_FILES =                 \
113         $(DOC_MODULE).args      \
114         $(DOC_MODULE).hierarchy \
115         $(DOC_MODULE).signals
116
117 if HAVE_GTK_DOC
118 all-local: html-build.stamp
119
120 #### scan ####
121
122
123 # wingo addition
124 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
125         @echo '*** Scanning header files ***'
126         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
127             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" $(GTK_DOC_SCANOBJ) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
128         else \
129             cd $(srcdir) ; \
130             for i in $(SCANOBJ_FILES) ; do \
131                test -f $$i || touch $$i ; \
132             done \
133         fi
134         cd $(srcdir) && \
135           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
136         touch scan-build.stamp
137
138 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
139         @true
140
141 #### templates ####
142
143 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
144         @echo '*** Rebuilding template files ***'
145         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
146         touch tmpl-build.stamp
147
148 tmpl.stamp: tmpl-build.stamp
149         @true
150
151 #### sgml ####
152
153 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
154         @echo '*** Building SGML ***'
155         cd $(srcdir) && \
156         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
157         touch sgml-build.stamp
158
159 sgml.stamp: sgml-build.stamp
160         @true
161
162 #### html ####
163
164 # FIXME: setting LANG=C is a hack to work with gtk-doc < 1.1, because
165 # that forces a non-utf8 locale.  gtk-doc >= 1.1 solves this by calling
166 # use bytes; in gtkdoc-fixxref
167 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
168         @echo '*** Building HTML ***'
169         test -d $(srcdir)/html || mkdir $(srcdir)/html
170         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
171         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
172         @echo '-- Fixing Crossreferences' 
173         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
174         touch html-build.stamp
175 endif
176
177 clean-local:
178         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
179         rm -rf xml html
180
181 maintainer-clean-local: clean
182         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
183
184 # FIXME : thomas added all sgml files and some other things to make
185 # make distcheck work
186 distclean-local: clean
187         rm -rf $(DOC_MODULE)-decl-list.txt
188         rm -rf $(DOC_MODULE)-*.txt
189         rm -rf tmpl/*.sgml
190         rm -f $(DOC_MODULE).hierarchy
191         rm -f *.stamp || true
192
193 install-data-local:
194         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
195         (installfiles=`echo $(srcdir)/html/*.html $(srcdir)/html/*.png`; \
196         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
197         then echo '-- Nothing to install' ; \
198         else \
199           for i in $$installfiles; do \
200             echo '-- Installing '$$i ; \
201             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
202           done; \
203           echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
204           $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
205             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
206           echo '-- Installing $(srcdir)/html/index.sgml' ; \
207           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
208         fi)
209
210 #
211 # Require gtk-doc when making dist
212 #
213 if HAVE_GTK_DOC
214 dist-check-gtkdoc:
215 else
216 dist-check-gtkdoc:
217         @echo "*** gtk-doc must be installed and enabled in order to make dist"
218         @false
219 endif
220
221 dist-hook: dist-check-gtkdoc dist-hook-local
222         mkdir $(distdir)/tmpl
223         mkdir $(distdir)/xml
224         mkdir $(distdir)/html
225         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
226         -cp $(srcdir)/sgml/*.xml $(distdir)/xml
227         -cp $(srcdir)/html/index.sgml $(distdir)/html
228         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
229
230         images=$(HTML_IMAGES) ;               \
231         for i in $$images ; do                \
232           cp $(srcdir)/$$i $(distdir)/html ;  \
233         done
234
235 .PHONY : dist-hook-local