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