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