Fixed makefiles for docs
[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.
4 DOC_MODULE=gstreamer
5
6 # The top-level SGML file.
7 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
8
9 # The directory containing the source code (if it contains documentation).
10 DOC_SOURCE_DIR=$(top_srcdir)/gst
11
12 CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir)
13 LDFLAGS = $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/gst/.libs/libgst.so $(top_srcdir)/gst/elements/.libs/libgstelements.so
14
15 EXTRA_DIST = gstreamer.types.in gstreamer.hierarchy $(DOC_MODULE)-sections.txt $(DOC_MAIN_SGML_FILE)
16
17 HTML_DIR=$(datadir)/gstreamer/html
18
19 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
20
21 tmpl_sources =                          \
22         tmpl/audioraw.sgml              \
23         tmpl/cothreads.sgml             \
24         tmpl/gst.sgml                   \
25         tmpl/gstinfo.sgml               \
26         tmpl/gstasyncdisksrc.sgml       \
27         tmpl/gstautoplug.sgml           \
28         tmpl/gstscheduler.sgml          \
29         tmpl/gstprops.sgml              \
30         tmpl/gstcaps.sgml               \
31         tmpl/gstaudiosink.sgml          \
32         tmpl/gstaudiosrc.sgml           \
33         tmpl/gstbin.sgml                \
34         tmpl/gstbuffer.sgml             \
35         tmpl/gstbufferpool.sgml         \
36         tmpl/gstdisksrc.sgml            \
37         tmpl/gstelement.sgml            \
38         tmpl/gstesdsink.sgml            \
39         tmpl/gstfakesink.sgml           \
40         tmpl/gstfakesrc.sgml            \
41         tmpl/gstfdsink.sgml             \
42         tmpl/gstfdsrc.sgml              \
43         tmpl/gsthttpsrc.sgml            \
44         tmpl/gstidentity.sgml           \
45         tmpl/gstlog.sgml                \
46         tmpl/gstmeta.sgml               \
47         tmpl/gstobject.sgml             \
48         tmpl/gstpad.sgml                \
49         tmpl/gstpipeline.sgml           \
50         tmpl/gstplugin.sgml             \
51         tmpl/gstqueue.sgml              \
52         tmpl/gstreamer-unused.sgml      \
53         tmpl/gstsinesrc.sgml            \
54         tmpl/gsttee.sgml                \
55         tmpl/gstthread.sgml             \
56         tmpl/gsttrace.sgml              \
57         tmpl/gsttype.sgml               \
58         tmpl/gstutils.sgml              \
59         tmpl/gstxml.sgml                \
60         tmpl/spectrum.sgml              \
61         tmpl/videoraw.sgml
62
63 gstreamer_docdir = $(HTML_DIR)
64 gstreamer_doc_DATA =            \
65         gstreamer.html          \
66         gstreamer.types         \
67         gstreamer.hierarchy     \
68         gstreamer-sections.txt
69
70 SCANOBJS_FILES =                \
71         $(DOC_MODULE).signals   \
72         $(DOC_MODULE).hierarchy \
73         $(DOC_MODULE).args
74
75 if HAVE_GTK_DOC
76 gstreamer.html: html/book1.html
77         -cd $(srcdir) && cp html/book1.html gstreamer.html
78 else
79 gstreamer.html:
80 endif
81
82 html/book1.html: sgml/gstreamer-doc.bottom
83         $(MAKE) html
84
85 sgml/gstreamer-doc.bottom: $(tmpl_sources)
86         $(MAKE) sgml
87
88 gstreamer-decl.txt:
89         gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers=""
90
91 scanobj: $(srcdir)/$(DOC_MODULE).types
92         -CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" gtkdoc-scanobj --module=$(DOC_MODULE)
93         gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)
94
95 tmpl: scanobj gstreamer-decl.txt
96         gtkdoc-mktmpl --module=$(DOC_MODULE)
97
98 sgml: tmpl
99         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)
100
101 html: sgml
102         if ! test -d html ; then mkdir html ; fi
103         -cd html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
104
105 clean-local:
106         rm -f *~ *.bak *.signals *-unused.txt *.args
107
108 maintainer-clean-local: clean
109         rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt 
110
111 install-data-local: gstreamer.html
112         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
113         (installfiles=`echo $(srcdir)/html/*.html`; \
114         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
115         then echo '-- Nothing to install' ; \
116         else \
117           for i in $$installfiles; do \
118             echo '-- Installing '$$i ; \
119             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
120           done; \
121           echo '-- Installing $(srcdir)/html/index.sgml' ; \
122           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
123           echo '-- Fixing Crossreferences' ; \
124           gtkdoc-fixxref --module=$(DOC_MODULE) --html-dir=$(HTML_DIR)|| true; \
125         fi)
126
127 dist-hook: gstreamer.html
128         mkdir $(distdir)/html
129         mkdir $(distdir)/sgml
130         mkdir $(distdir)/tmpl
131         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
132         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
133         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
134         -cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
135
136 .PHONY : html sgml tmpl