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