clock: Improve slaving regression.
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_API_VERSION@.la
2
3 if GST_DISABLE_REGISTRY
4 GST_REGISTRY_SRC =
5 else
6 GST_REGISTRY_SRC = gstregistrybinary.c
7 endif
8
9 if GST_DISABLE_PARSE
10 SUBDIRS_PARSE =
11 GST_PARSE_LA =
12 else
13 SUBDIRS_PARSE = parse
14 GST_PARSE_LA = parse/libgstparse.la
15 endif
16
17 if GST_DISABLE_TRACE
18 GST_TRACE_SRC =
19 else
20 GST_TRACE_SRC = gsttrace.c
21 endif
22
23 if GST_DISABLE_PLUGIN
24 GST_PLUGIN_SRC =
25 else
26 GST_PLUGIN_SRC = gstplugin.c
27 endif
28
29 if !GST_DISABLE_GST_DEBUG
30 SUBDIRS_PRINTF = printf
31 GST_PRINTF_LA = printf/libgstprintf.la
32 else
33 SUBDIRS_PRINTF =
34 GST_PRINTF_LA =
35 endif
36
37 SUBDIRS = $(SUBDIRS_PARSE) $(SUBDIRS_PRINTF)
38
39 DIST_SUBDIRS = parse printf
40
41 # make variables for all generated source and header files to make the
42 # distinction clear
43
44 built_header_configure = gstversion.h
45 built_sys_header_configure = gstconfig.h
46 built_header_make = gstenumtypes.h
47 built_source_make = gstenumtypes.c
48
49 EXTRA_libgstreamer_@GST_API_VERSION@_la_SOURCES = \
50         gsttrace.c \
51         gstregistrybinary.c
52
53
54 # temporarily not used
55 #       glib-compat.c
56
57 libgstreamer_@GST_API_VERSION@_la_SOURCES = \
58         gst.c                   \
59         gstobject.c             \
60         gstallocator.c          \
61         gstbin.c                \
62         gstbuffer.c             \
63         gstbufferlist.c         \
64         gstbufferpool.c         \
65         gstbus.c                \
66         gstcaps.c               \
67         gstcapsfeatures.c       \
68         gstchildproxy.c         \
69         gstclock.c              \
70         gstclock-linreg.c       \
71         gstcontext.c \
72         gstcontrolbinding.c \
73         gstcontrolsource.c \
74         gstdatetime.c           \
75         gstdebugutils.c         \
76         gstdevice.c             \
77         gstdeviceprovider.c     \
78         gstdeviceproviderfactory.c \
79         gstelement.c            \
80         gstelementfactory.c     \
81         gsterror.c              \
82         gstevent.c              \
83         gstformat.c             \
84         gstghostpad.c           \
85         gstdevicemonitor.c      \
86         gstinfo.c               \
87         gstiterator.c           \
88         gstatomicqueue.c        \
89         gstmessage.c            \
90         gstmeta.c               \
91         gstmemory.c             \
92         gstminiobject.c         \
93         gstpad.c                \
94         gstpadtemplate.c        \
95         gstparamspecs.c         \
96         gstpipeline.c           \
97         gstplugin.c             \
98         gstpluginfeature.c      \
99         gstpluginloader.c       \
100         gstpoll.c               \
101         gstpreset.c             \
102         gstquark.c              \
103         gstquery.c              \
104         gstregistry.c           \
105         gstregistrychunks.c     \
106         gstsample.c             \
107         gstsegment.c            \
108         gststructure.c          \
109         gstsystemclock.c        \
110         gsttaglist.c            \
111         gsttagsetter.c          \
112         gsttask.c               \
113         gsttaskpool.c           \
114         gsttoc.c                \
115         gsttocsetter.c          \
116         $(GST_TRACE_SRC)        \
117         gsttypefind.c           \
118         gsttypefindfactory.c    \
119         gsturi.c                \
120         gstutils.c              \
121         gstvalue.c              \
122         gstparse.c              \
123         $(GST_REGISTRY_SRC)
124
125 # do not put files in the distribution that are generated
126 nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES = $(built_source_make)
127
128 # BUILT_SOURCES are built on make all/check/install before all other targets
129 BUILT_SOURCES = \
130         $(built_header_configure)       \
131         $(built_sys_header_configure)   \
132         $(built_header_make)            \
133         $(built_source_make)
134 # CLEANFILES is for files generated by make
135 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
136 # DISTCLEANFILES is for files generated by configure
137 DISTCLEANFILES = $(built_header_configure) $(built_sys_header_configure)
138
139 libgstreamer_@GST_API_VERSION@_la_CFLAGS =              \
140         -D_GNU_SOURCE                                   \
141         -DGST_EXPORTS                                   \
142         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
143         -DGST_API_VERSION=\""$(GST_API_VERSION)"\"      \
144         -DGST_DISABLE_DEPRECATED                        \
145         $(VALGRIND_CFLAGS)                              \
146         $(GST_ALL_CFLAGS)
147
148 libgstreamer_@GST_API_VERSION@_la_LIBADD =              \
149         $(GST_PARSE_LA)                                 \
150         $(GST_PRINTF_LA)                                \
151         $(GST_ALL_LIBS)                                 \
152         $(WIN32_LIBS)                                   \
153         $(LIBM)
154
155 libgstreamer_@GST_API_VERSION@_la_LDFLAGS =             \
156         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
157
158 libgstreamer_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst
159
160 gst_headers =                   \
161         gst.h                   \
162         glib-compat.h           \
163         gstobject.h             \
164         gstallocator.h          \
165         gstbin.h                \
166         gstbuffer.h             \
167         gstbufferlist.h         \
168         gstbufferpool.h         \
169         gstbus.h                \
170         gstcaps.h               \
171         gstcapsfeatures.h       \
172         gstchildproxy.h         \
173         gstclock.h              \
174         gstcompat.h             \
175         gstcontext.h \
176         gstcontrolbinding.h \
177         gstcontrolsource.h \
178         gstdatetime.h           \
179         gstdebugutils.h         \
180         gstelement.h            \
181         gstelementmetadata.h    \
182         gstdevice.h             \
183         gstdeviceprovider.h     \
184         gstdeviceproviderfactory.h \
185         gstelementfactory.h     \
186         gsterror.h              \
187         gstevent.h              \
188         gstformat.h             \
189         gstghostpad.h           \
190         gstdevicemonitor.h      \
191         gstinfo.h               \
192         gstiterator.h           \
193         gstatomicqueue.h        \
194         gstmacros.h             \
195         gstmessage.h            \
196         gstmeta.h               \
197         gstmemory.h             \
198         gstminiobject.h         \
199         gstpad.h                \
200         gstpadtemplate.h        \
201         gstparamspecs.h         \
202         gstpipeline.h           \
203         gstplugin.h             \
204         gstpluginfeature.h      \
205         gstpoll.h               \
206         gstpreset.h             \
207         gstquery.h              \
208         gstsample.h             \
209         gstsegment.h            \
210         gststructure.h          \
211         gstsystemclock.h        \
212         gsttaglist.h            \
213         gsttagsetter.h          \
214         gsttask.h               \
215         gsttaskpool.h           \
216         gsttoc.h                \
217         gsttocsetter.h          \
218         gsttypefind.h           \
219         gsttypefindfactory.h    \
220         gsturi.h                \
221         gstutils.h              \
222         gstvalue.h              \
223         gstregistry.h           \
224         gstparse.h
225
226 libgstreamer_@GST_API_VERSION@include_HEADERS = $(gst_headers) math-compat.h
227
228 nodist_libgstreamer_@GST_API_VERSION@include_HEADERS = \
229         $(built_header_configure) $(built_header_make)
230
231 configexecincludedir = $(libdir)/gstreamer-@GST_API_VERSION@/include/gst
232 nodist_configexecinclude_HEADERS = $(built_sys_header_configure)
233
234 noinst_HEADERS =                \
235         gettext.h               \
236         glib-compat-private.h   \
237         gst-i18n-lib.h          \
238         gst-i18n-app.h          \
239         gstelementmetadata.h    \
240         gstpluginloader.h       \
241         gstquark.h              \
242         gstregistrybinary.h     \
243         gstregistrychunks.h     \
244         gsttrace.h              \
245         gst_private.h
246
247 gstenumtypes.h: $(gst_headers)
248         $(AM_V_GEN)$(GLIB_MKENUMS) \
249         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
250         --fprod "\n/* enumerations from \"@filename@\" */\n" \
251         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
252         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
253         $^ > gstenumtypes.h
254
255 gstenumtypes.c: $(gst_headers)
256         $(AM_V_GEN)$(GLIB_MKENUMS) \
257         --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>\n#define C_ENUM(v) ((gint) v)\n#define C_FLAGS(v) ((guint) v)\n " \
258         --fprod "\n/* enumerations from \"@filename@\" */" \
259         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static gsize id = 0;\n  static const G@Type@Value values[] = {"     \
260         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
261         --vtail "    { 0, NULL, NULL }\n  };\n\n  if (g_once_init_enter (&id)) {\n    GType tmp = g_@type@_register_static (\"@EnumName@\", values);\n    g_once_init_leave (&id, tmp);\n  }\n\n  return (GType) id;\n}" \
262         $^ > gstenumtypes.c
263
264 %.c.gcov: .libs/libgstreamer_@GST_API_VERSION@_la-%.gcda %.c
265         $(GCOV) -b -f -o $^ > $@.out
266
267 gcov: $(libgstreamer_@GST_API_VERSION@_la_SOURCES:=.gcov)
268
269 Android.mk: Makefile.am
270         androgenizer -:PROJECT gstreamer -:SHARED libgstreamer-@GST_API_VERSION@ \
271          -:TAGS eng debug \
272          -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
273          -:SOURCES $(libgstreamer_@GST_API_VERSION@_la_SOURCES) \
274                    $(nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES) \
275          -:CFLAGS $(DEFS) $(libgstreamer_@GST_API_VERSION@_la_CFLAGS) \
276          -:LDFLAGS $(libgstreamer_@GST_API_VERSION@_la_LDFLAGS) \
277                    $(libgstreamer_@GST_API_VERSION@_la_LIBADD) \
278                    -ldl \
279          -:SUBDIR gst/parse \
280          -:HEADER_TARGET gstreamer-@GST_API_VERSION@/gst \
281          -:HEADERS $(libgstreamer_@GST_API_VERSION@include_HEADERS) \
282          -:LIBFILTER_STATIC gstparse \
283          -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
284         > $@
285
286 if HAVE_INTROSPECTION
287 BUILT_GIRSOURCES = Gst-@GST_API_VERSION@.gir
288
289 gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@include_HEADERS))
290 gir_headers+=$(patsubst %,$(builddir)/%, $(built_header_make))
291 gir_headers+=$(patsubst %,$(builddir)/%, gstversion.h)
292 gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@_la_SOURCES))
293 gir_sources+=$(patsubst %,$(builddir)/%, $(built_source_make))
294
295 Gst-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_API_VERSION@.la
296         $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
297                 $(INTROSPECTION_SCANNER) -v --namespace Gst \
298                 --nsversion=@GST_API_VERSION@ \
299                 --warn-all \
300                 -I$(top_srcdir) \
301                 -I$(top_builddir) \
302                 -DIN_GOBJECT_INTROSPECTION=1 \
303                 --c-include='gst/gst.h' \
304                 --library=libgstreamer-@GST_API_VERSION@.la \
305                 --include=GLib-2.0 \
306                 --include=GObject-2.0 \
307                 --include=GModule-2.0 \
308                 --libtool="${LIBTOOL}" \
309                 --pkg glib-2.0 \
310                 --pkg gobject-2.0 \
311                 --pkg gmodule-no-export-2.0 \
312                 --pkg-export gstreamer-@GST_API_VERSION@ \
313                 --add-init-section="gst_init(NULL, NULL);" \
314                 --output $@ \
315                 $(gir_headers) \
316                 $(gir_sources)
317
318 # INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
319 # install anything - we need to install inside our prefix.
320 girdir = $(datadir)/gir-1.0
321 gir_DATA = $(BUILT_GIRSOURCES)
322
323 typelibsdir = $(libdir)/girepository-1.0/
324
325 typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
326
327 %.typelib: %.gir $(INTROSPECTION_COMPILER)
328         $(AM_V_GEN)$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=$(builddir) $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
329
330 CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
331 endif
332
333 # try to prevent packaging errors
334 check-libexecdir-consistency:
335         @if test "${GST_PLUGIN_SCANNER_INSTALLED}" != "${libexecdir}/gstreamer-$(GST_API_VERSION)/gst-plugin-scanner"; then \
336           echo "*** Inconsistent libexecdir! Please use ./configure --libexecdir=/foo/bar"; \
337           echo "*** to set the libexecdir and not make libexecdir=/foo/bar or the like."; \
338           echo "*** The same goes for prefix, libdir etc."; \
339           echo "*** ${GST_PLUGIN_SCANNER_INSTALLED} != ${libexecdir}/gstreamer-$(GST_API_VERSION)/gst-plugin-scanner"; \
340           exit 1; \
341         fi
342
343 all-local: check-libexecdir-consistency