commit Brian's patch with AC fix from thomas
[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 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
70
71 EXTRA_DIST =                            \
72         $(content_files)                \
73         $(extra_files)                  \
74         $(HTML_IMAGES)                  \
75         $(DOC_MAIN_SGML_FILE)           \
76         $(DOC_MODULE).types             
77 #       $(DOC_MODULE)-sections.txt
78
79 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
80            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
81
82 SCANOBJ_FILES =                 \
83         $(DOC_MODULE).args      \
84         $(DOC_MODULE).hierarchy \
85         $(DOC_MODULE).signals
86
87 if HAVE_GTK_DOC
88 all-local: html-build.stamp
89
90 #### scan ####
91
92 # wingo addition
93 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS)
94         @echo '*** Scanning header files ***'
95         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
96             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" $(GTK_DOC_SCANOBJ) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
97         else \
98             cd $(srcdir) ; \
99             for i in $(SCANOBJ_FILES) ; do \
100                test -f $$i || touch $$i ; \
101             done \
102         fi
103         cd $(srcdir) && \
104           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
105         touch scan-build.stamp
106
107 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
108         @true
109
110 #### templates ####
111
112 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
113         @echo '*** Rebuilding template files ***'
114         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
115         touch tmpl-build.stamp
116
117 tmpl.stamp: tmpl-build.stamp
118         @true
119
120 #### sgml ####
121
122 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
123         @echo '*** Building SGML ***'
124         cd $(srcdir) && \
125         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
126         touch sgml-build.stamp
127
128 sgml.stamp: sgml-build.stamp
129         @true
130
131 #### html ####
132
133 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
134         @echo '*** Building HTML ***'
135         test -d $(srcdir)/html || mkdir $(srcdir)/html
136         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
137         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
138         @echo '-- Fixing Crossreferences' 
139         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
140         touch html-build.stamp
141 endif
142
143 clean-local:
144         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
145
146 maintainer-clean-local: clean
147         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
148
149 # FIXME : thomas added all sgml files and some other things to make
150 # make distcheck work
151 distclean-local: clean
152         rm -rf $(DOC_MODULE)-decl-list.txt
153         rm -rf gstreamer-*.txt
154         rm -rf tmpl/*.sgml
155         rm -f gstreamer.hierarchy
156         rm -f *.stamp || true
157
158 install-data-local:
159         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
160         (installfiles=`echo $(srcdir)/html/*.html`; \
161         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
162         then echo '-- Nothing to install' ; \
163         else \
164           for i in $$installfiles; do \
165             echo '-- Installing '$$i ; \
166             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
167           done; \
168           echo '-- Installing $(srcdir)/html/index.sgml' ; \
169           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
170         fi)
171
172 #
173 # Require gtk-doc when making dist
174 #
175 if HAVE_GTK_DOC
176 dist-check-gtkdoc:
177 else
178 dist-check-gtkdoc:
179         @echo "*** gtk-doc must be installed and enabled in order to make dist"
180         @false
181 endif
182
183 dist-hook: dist-check-gtkdoc dist-hook-local
184         mkdir $(distdir)/tmpl
185         mkdir $(distdir)/sgml
186         mkdir $(distdir)/html
187         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
188         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
189         -cp $(srcdir)/html/index.sgml $(distdir)/html
190         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
191
192         images=$(HTML_IMAGES) ;               \
193         for i in $$images ; do                \
194           cp $(srcdir)/$$i $(distdir)/html ;  \
195         done
196
197 .PHONY : dist-hook-local