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