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