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