4a8df1d09772d60acfe9fdba9b28be0d01edd40a
[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         gstcontrolbinding.c \
60         gstcontrolsource.c \
61         gstdatetime.c           \
62         gstdebugutils.c         \
63         gstelement.c            \
64         gstelementfactory.c     \
65         gsterror.c              \
66         gstevent.c              \
67         gstformat.c             \
68         gstghostpad.c           \
69         gstindex.c              \
70         gstindexfactory.c       \
71         gstinfo.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         gstsample.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         $(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         gstcontrolbinding.h \
155         gstcontrolsource.h \
156         gstdatetime.h           \
157         gstdebugutils.h         \
158         gstelement.h            \
159         gstelementmetadata.h    \
160         gstelementfactory.h     \
161         gsterror.h              \
162         gstevent.h              \
163         gstformat.h             \
164         gstghostpad.h           \
165         gstindex.h              \
166         gstindexfactory.h       \
167         gstinfo.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         gstsample.h             \
185         gstsegment.h            \
186         gststructure.h          \
187         gstsystemclock.h        \
188         gsttaglist.h            \
189         gsttagsetter.h          \
190         gsttask.h               \
191         gsttaskpool.h           \
192         gsttrace.h              \
193         gsttypefind.h           \
194         gsttypefindfactory.h    \
195         gsturi.h                \
196         gstutils.h              \
197         gstvalue.h              \
198         gstregistry.h           \
199         gstparse.h
200
201 libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers) math-compat.h
202
203 nodist_libgstreamer_@GST_MAJORMINOR@include_HEADERS = \
204         $(built_header_configure) $(built_header_make)
205
206 noinst_HEADERS =                \
207         gettext.h               \
208         glib-compat-private.h   \
209         gst-i18n-lib.h          \
210         gst-i18n-app.h          \
211         gstelementmetadata.h    \
212         gstpluginloader.h       \
213         gstquark.h              \
214         gstregistrybinary.h     \
215         gstregistrychunks.h     \
216         gst_private.h
217
218 gstmarshal.h: gstmarshal.list
219         $(AM_V_GEN)glib-genmarshal --header --prefix=gst_marshal $(srcdir)/gstmarshal.list > gstmarshal.h.tmp && \
220         mv gstmarshal.h.tmp gstmarshal.h
221
222 gstmarshal.c: gstmarshal.list gst_private.h
223         $(AM_V_GEN)echo "#include \"gst_private.h\"" > gstmarshal.c.tmp && \
224         echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp && \
225         echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp && \
226         glib-genmarshal --body --prefix=gst_marshal $(srcdir)/gstmarshal.list >> gstmarshal.c.tmp && \
227         mv gstmarshal.c.tmp gstmarshal.c
228
229 gstenumtypes.h: $(gst_headers)
230         $(AM_V_GEN)glib-mkenums \
231         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
232         --fprod "\n/* enumerations from \"@filename@\" */\n" \
233         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
234         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
235         $^ > gstenumtypes.h
236
237 gstenumtypes.c: $(gst_headers)
238         $(AM_V_GEN)glib-mkenums \
239         --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 " \
240         --fprod "\n/* enumerations from \"@filename@\" */" \
241         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static gsize id = 0;\n  static const G@Type@Value values[] = {"     \
242         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
243         --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}" \
244         $^ > gstenumtypes.c
245
246 %.c.gcov: .libs/libgstreamer_@GST_MAJORMINOR@_la-%.gcda %.c
247         $(GCOV) -b -f -o $^ > $@.out
248
249 gcov: $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES:=.gcov)
250
251 Android.mk: Makefile.am
252         androgenizer -:PROJECT gstreamer -:SHARED libgstreamer-@GST_MAJORMINOR@ \
253          -:TAGS eng debug \
254          -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
255          -:SOURCES $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES) \
256                    $(nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES) \
257          -:CFLAGS $(DEFS) $(libgstreamer_@GST_MAJORMINOR@_la_CFLAGS) \
258          -:LDFLAGS $(libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS) \
259                    $(libgstreamer_@GST_MAJORMINOR@_la_LIBADD) \
260                    -ldl \
261          -:SUBDIR gst/parse \
262          -:HEADER_TARGET gstreamer-@GST_MAJORMINOR@/gst \
263          -:HEADERS $(libgstreamer_@GST_MAJORMINOR@include_HEADERS) \
264          -:LIBFILTER_STATIC gstparse \
265          -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
266         > $@
267
268 if HAVE_INTROSPECTION
269 BUILT_GIRSOURCES = Gst-@GST_MAJORMINOR@.gir
270
271 gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@include_HEADERS))
272 gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES))
273
274 Gst-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_MAJORMINOR@.la
275         $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH="" GST_PLUGIN_PATH="" GST_REGISTRY_UPDATE=no \
276                 $(INTROSPECTION_SCANNER) -v --namespace Gst \
277                 --nsversion=@GST_MAJORMINOR@ \
278                 --warn-all \
279                 -I$(top_srcdir) \
280                 -I$(top_builddir) \
281                 -DIN_GOBJECT_INTROSPECTION=1 \
282                 -DGST_USE_UNSTABLE_API \
283                 --c-include='gst/gst.h' \
284                 --library=libgstreamer-0.11.la \
285                 --include=GLib-2.0 \
286                 --include=GObject-2.0 \
287                 --include=GModule-2.0 \
288                 --libtool="$(top_builddir)/libtool" \
289                 --pkg glib-2.0 \
290                 --pkg gobject-2.0 \
291                 --pkg gmodule-no-export-2.0 \
292                 --pkg gthread-2.0 \
293                 --pkg-export gstreamer-@GST_MAJORMINOR@ \
294                 --add-init-section="gst_init(NULL, NULL);" \
295                 --output $@ \
296                 $(gir_headers) \
297                 $(gir_sources)
298
299 # INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
300 # install anything - we need to install inside our prefix.
301 girdir = $(datadir)/gir-1.0
302 gir_DATA = $(BUILT_GIRSOURCES)
303
304 typelibsdir = $(libdir)/girepository-1.0/
305
306 typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
307
308 %.typelib: %.gir $(INTROSPECTION_COMPILER)
309         $(AM_V_GEN)$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=$(builddir) $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
310
311 CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
312 endif
313
314 # try to prevent packaging errors
315 check-libexecdir-consistency:
316         @if test "${GST_PLUGIN_SCANNER_INSTALLED}" != "${libexecdir}/gstreamer-$(GST_MAJORMINOR)/gst-plugin-scanner"; then \
317           echo "*** Inconsistent libexecdir! Please use ./configure --libexecdir=/foo/bar"; \
318           echo "*** to set the libexecdir and not make libexecdir=/foo/bar or the like."; \
319           echo "*** The same goes for prefix, libdir etc."; \
320           echo "*** ${GST_PLUGIN_SCANNER_INSTALLED} != ${libexecdir}/gstreamer-$(GST_MAJORMINOR)/gst-plugin-scanner"; \
321           exit 1; \
322         fi
323
324 all-local: check-libexecdir-consistency