configure.ac: set CFLAGS and friends to -O0 if gcov is being used add GCOV LIBS
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_MAJORMINOR@.la
2
3 if GST_DISABLE_LOADSAVE
4 GST_LOADSAVE_SRC = 
5 else
6 GST_LOADSAVE_SRC = gstxml.c
7 endif
8
9 if GST_DISABLE_REGISTRY
10 GST_REGISTRY_SRC = 
11 else
12 GST_REGISTRY_SRC = gstregistryxml.c
13 endif
14
15 if GST_DISABLE_PARSE
16 GST_PARSE_SRC = 
17 GST_PARSE_H = 
18 SUBDIRS_PARSE = 
19 GST_PARSE_LA = 
20 else
21 GST_PARSE_SRC = gstparse.c
22 GST_PARSE_H = gstparse.h
23 SUBDIRS_PARSE = parse
24 GST_PARSE_LA = parse/libgstparse.la 
25 endif
26
27 if GST_DISABLE_TRACE
28 GST_TRACE_SRC = 
29 else
30 GST_TRACE_SRC = gsttrace.c
31 endif
32
33 if GST_DISABLE_ENUMTYPES
34 GST_ENUMTYPES_SRC = 
35 else
36 GST_ENUMTYPES_SRC = gstenumtypes.c
37 endif
38
39 if GST_DISABLE_INDEX
40 GST_INDEX_SRC = 
41 else
42 GST_INDEX_SRC = gstindex.c gstindexfactory.c
43 endif
44
45 if GST_DISABLE_PLUGIN
46 GST_PLUGIN_SRC = 
47 else
48 GST_PLUGIN_SRC = gstplugin.c
49 endif
50
51 if GST_DISABLE_URI
52 GST_URI_SRC = 
53 else
54 GST_URI_SRC = gsturi.c
55 endif
56
57 SUBDIRS = $(SUBDIRS_PARSE)
58
59 DIST_SUBDIRS = parse
60
61 # make variables for all generated source and header files to make the
62 # distinction clear
63                                                                                 
64 built_header_configure = gstconfig.h gstversion.h
65 built_header_make = gstenumtypes.h gstmarshal.h
66 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
67
68 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
69         gstmarshal.list gstxml.c gstparse.c gsttrace.c gstregistryxml.c
70
71 libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
72         gst.c                   \
73         gstobject.c             \
74         gstbin.c                \
75         gstbuffer.c             \
76         gstbus.c                \
77         gstcaps.c               \
78         gstchildproxy.c         \
79         gstclock.c              \
80         gstelement.c            \
81         gstelementfactory.c     \
82         gsterror.c              \
83         gstevent.c              \
84         gstfilter.c             \
85         gstformat.c             \
86         gstghostpad.c           \
87         $(GST_INDEX_SRC)        \
88         gstinfo.c               \
89         gstinterface.c          \
90         gstiterator.c           \
91         gstmessage.c            \
92         gstminiobject.c         \
93         gstpad.c                \
94         gstpadtemplate.c        \
95         gstpipeline.c           \
96         gstplugin.c             \
97         gstpluginfeature.c      \
98         gstquery.c              \
99         gstregistry.c           \
100         gstsegment.c            \
101         gststructure.c          \
102         gstsystemclock.c        \
103         gsttaglist.c            \
104         gsttagsetter.c          \
105         gsttask.c               \
106         $(GST_TRACE_SRC)        \
107         gsttypefind.c           \
108         gsttypefindfactory.c    \
109         $(GST_URI_SRC)          \
110         gstutils.c              \
111         gstvalue.c              \
112         $(GST_PARSE_SRC)        \
113         $(GST_REGISTRY_SRC)     \
114         $(GST_LOADSAVE_SRC)
115
116 # do not put files in the distribution that are generated
117 nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
118
119 # BUILT_SOURCES are built on make all/check/install before all other targets
120 BUILT_SOURCES = \
121         $(built_header_configure)       \
122         $(built_header_make)            \
123         $(built_source_make)
124 # CLEANFILES is for files generated by make
125 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
126 # DISTCLEANFILES is for files generated by configure
127 DISTCLEANFILES = $(built_header_configure)
128                                                                                 
129 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =               \
130         -D_GNU_SOURCE                                   \
131         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
132         -DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\"        \
133         -DGST_DISABLE_DEPRECATED                        \
134         $(VALGRIND_CFLAGS)                              \
135         $(GST_ALL_CFLAGS)
136
137 libgstreamer_@GST_MAJORMINOR@_la_LIBADD =               \
138         $(GST_PARSE_LA)                                 \
139         $(GST_ALL_LIBS)                                 \
140         $(XML_LIBS)
141
142 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS =              \
143         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
144
145 libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst
146
147 gst_headers =                   \
148         gst.h                   \
149         glib-compat.c           \
150         glib-compat.h           \
151         gstobject.h             \
152         gstbin.h                \
153         gstbuffer.h             \
154         gstbus.h                \
155         gstcaps.h               \
156         gstchildproxy.h         \
157         gstclock.h              \
158         gstcompat.h             \
159         gstelement.h            \
160         gstelementfactory.h     \
161         gsterror.h              \
162         gstevent.h              \
163         gstfilter.h             \
164         gstformat.h             \
165         gstghostpad.h           \
166         gstindex.h              \
167         gstindexfactory.h       \
168         gstinfo.h               \
169         gstinterface.h          \
170         gstiterator.h           \
171         gstmacros.h             \
172         gstmessage.h            \
173         gstminiobject.h         \
174         gstpad.h                \
175         gstpadtemplate.h        \
176         gstpipeline.h           \
177         gstplugin.h             \
178         gstpluginfeature.h      \
179         gstquery.h              \
180         gstsegment.h            \
181         gststructure.h          \
182         gstsystemclock.h        \
183         gsttaglist.h            \
184         gsttagsetter.h          \
185         gsttask.h               \
186         gsttrace.h              \
187         gsttypefind.h           \
188         gsttypefindfactory.h    \
189         gsturi.h                \
190         gstutils.h              \
191         gstvalue.h              \
192         gstregistry.h           \
193         $(GST_PARSE_H)          \
194         gstxml.h
195
196 libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers)
197 nodist_libgstreamer_@GST_MAJORMINOR@include_HEADERS = \
198         $(built_header_configure) $(built_header_make)
199
200 EXTRA_DIST = \
201         gstparse.h
202
203 noinst_HEADERS =                \
204         gettext.h               \
205         glib-compat-private.h   \
206         gst-i18n-lib.h          \
207         gst-i18n-app.h          \
208         gst_private.h
209
210 gstmarshal.h: gstmarshal.list
211         glib-genmarshal --header --prefix=gst_marshal $(srcdir)/gstmarshal.list > gstmarshal.h.tmp
212         mv gstmarshal.h.tmp gstmarshal.h
213
214 gstmarshal.c: gstmarshal.list gst_private.h
215         echo "#include \"gst_private.h\"" > gstmarshal.c.tmp
216         echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp
217         echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp
218         glib-genmarshal --body --prefix=gst_marshal $(srcdir)/gstmarshal.list >> gstmarshal.c.tmp
219         mv gstmarshal.c.tmp gstmarshal.c
220
221 gstenumtypes.h: $(gst_headers)
222         glib-mkenums \
223         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
224         --fprod "\n/* enumerations from \"@filename@\" */\n" \
225         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
226         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
227         $^ > gstenumtypes.h
228
229 gstenumtypes.c: $(gst_headers)
230         glib-mkenums \
231         --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>" \
232         --fprod "\n/* enumerations from \"@filename@\" */" \
233         --vhead "static void\nregister_@enum_name@ (GType* id)\n{\n  static const G@Type@Value values[] = {"     \
234         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
235         --vtail "    { 0, NULL, NULL }\n  };\n  *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n  static GType id;\n  static GOnce once = G_ONCE_INIT;\n\n  g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n  return id;\n}\n" \
236         $^ > gstenumtypes.c
237
238 %.c.gcov: .libs/libgstreamer_@GST_MAJORMINOR@_la-%.gcda %.c
239         $(GCOV) -b -f -o $^ > $@.out
240
241 gcov: $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES:=.gcov)