87db0556f19a98b53f4d94323696b823e94caa45
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_API_VERSION@.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
38 built_source_make = gstenumtypes.c
39
40 EXTRA_libgstreamer_@GST_API_VERSION@_la_SOURCES = \
41         gsttrace.c \
42         gstregistrybinary.c
43
44
45 # temporarily not used
46 #       glib-compat.c
47
48 libgstreamer_@GST_API_VERSION@_la_SOURCES = \
49         gst.c                   \
50         gstobject.c             \
51         gstallocator.c          \
52         gstbin.c                \
53         gstbuffer.c             \
54         gstbufferlist.c         \
55         gstbufferpool.c         \
56         gstbus.c                \
57         gstcaps.c               \
58         gstchildproxy.c         \
59         gstclock.c              \
60         gstcontext.c \
61         gstcontrolbinding.c \
62         gstcontrolsource.c \
63         gstdatetime.c           \
64         gstdebugutils.c         \
65         gstelement.c            \
66         gstelementfactory.c     \
67         gsterror.c              \
68         gstevent.c              \
69         gstformat.c             \
70         gstghostpad.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         gsttoc.c                \
100         gsttocsetter.c          \
101         $(GST_TRACE_SRC)        \
102         gsttypefind.c           \
103         gsttypefindfactory.c    \
104         gsturi.c                \
105         gstutils.c              \
106         gstvalue.c              \
107         gstparse.c              \
108         $(GST_REGISTRY_SRC)
109
110 # do not put files in the distribution that are generated
111 nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES = $(built_source_make)
112
113 # BUILT_SOURCES are built on make all/check/install before all other targets
114 BUILT_SOURCES = \
115         $(built_header_configure)       \
116         $(built_header_make)            \
117         $(built_source_make)
118 # CLEANFILES is for files generated by make
119 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
120 # DISTCLEANFILES is for files generated by configure
121 DISTCLEANFILES = $(built_header_configure)
122
123 libgstreamer_@GST_API_VERSION@_la_CFLAGS =              \
124         -D_GNU_SOURCE                                   \
125         -DGST_EXPORTS                                   \
126         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
127         -DGST_API_VERSION=\""$(GST_API_VERSION)"\"      \
128         -DGST_DISABLE_DEPRECATED                        \
129         $(VALGRIND_CFLAGS)                              \
130         $(GST_ALL_CFLAGS)
131
132 libgstreamer_@GST_API_VERSION@_la_LIBADD =              \
133         $(GST_PARSE_LA)                                 \
134         $(GST_ALL_LIBS)                                 \
135         $(WIN32_LIBS)                                   \
136         $(LIBM)
137
138 libgstreamer_@GST_API_VERSION@_la_LDFLAGS =             \
139         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
140
141 libgstreamer_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst
142
143 gst_headers =                   \
144         gst.h                   \
145         glib-compat.h           \
146         gstobject.h             \
147         gstallocator.h          \
148         gstbin.h                \
149         gstbuffer.h             \
150         gstbufferlist.h         \
151         gstbufferpool.h         \
152         gstbus.h                \
153         gstcaps.h               \
154         gstchildproxy.h         \
155         gstclock.h              \
156         gstcompat.h             \
157         gstcontext.h \
158         gstcontrolbinding.h \
159         gstcontrolsource.h \
160         gstdatetime.h           \
161         gstdebugutils.h         \
162         gstelement.h            \
163         gstelementmetadata.h    \
164         gstelementfactory.h     \
165         gsterror.h              \
166         gstevent.h              \
167         gstformat.h             \
168         gstghostpad.h           \
169         gstinfo.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         gstsample.h             \
187         gstsegment.h            \
188         gststructure.h          \
189         gstsystemclock.h        \
190         gsttaglist.h            \
191         gsttagsetter.h          \
192         gsttask.h               \
193         gsttaskpool.h           \
194         gsttoc.h                \
195         gsttocsetter.h          \
196         gsttypefind.h           \
197         gsttypefindfactory.h    \
198         gsturi.h                \
199         gstutils.h              \
200         gstvalue.h              \
201         gstregistry.h           \
202         gstparse.h
203
204 libgstreamer_@GST_API_VERSION@include_HEADERS = $(gst_headers) math-compat.h
205
206 nodist_libgstreamer_@GST_API_VERSION@include_HEADERS = \
207         $(built_header_configure) $(built_header_make)
208
209 noinst_HEADERS =                \
210         gettext.h               \
211         glib-compat-private.h   \
212         gst-i18n-lib.h          \
213         gst-i18n-app.h          \
214         gstelementmetadata.h    \
215         gstpluginloader.h       \
216         gstquark.h              \
217         gstregistrybinary.h     \
218         gstregistrychunks.h     \
219         gsttrace.h              \
220         gst_private.h
221
222 gstenumtypes.h: $(gst_headers)
223         $(AM_V_GEN)$(GLIB_MKENUMS) \
224         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
225         --fprod "\n/* enumerations from \"@filename@\" */\n" \
226         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
227         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
228         $^ > gstenumtypes.h
229
230 gstenumtypes.c: $(gst_headers)
231         $(AM_V_GEN)$(GLIB_MKENUMS) \
232         --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 " \
233         --fprod "\n/* enumerations from \"@filename@\" */" \
234         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static gsize id = 0;\n  static const G@Type@Value values[] = {"     \
235         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
236         --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}" \
237         $^ > gstenumtypes.c
238
239 %.c.gcov: .libs/libgstreamer_@GST_API_VERSION@_la-%.gcda %.c
240         $(GCOV) -b -f -o $^ > $@.out
241
242 gcov: $(libgstreamer_@GST_API_VERSION@_la_SOURCES:=.gcov)
243
244 Android.mk: Makefile.am
245         androgenizer -:PROJECT gstreamer -:SHARED libgstreamer-@GST_API_VERSION@ \
246          -:TAGS eng debug \
247          -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
248          -:SOURCES $(libgstreamer_@GST_API_VERSION@_la_SOURCES) \
249                    $(nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES) \
250          -:CFLAGS $(DEFS) $(libgstreamer_@GST_API_VERSION@_la_CFLAGS) \
251          -:LDFLAGS $(libgstreamer_@GST_API_VERSION@_la_LDFLAGS) \
252                    $(libgstreamer_@GST_API_VERSION@_la_LIBADD) \
253                    -ldl \
254          -:SUBDIR gst/parse \
255          -:HEADER_TARGET gstreamer-@GST_API_VERSION@/gst \
256          -:HEADERS $(libgstreamer_@GST_API_VERSION@include_HEADERS) \
257          -:LIBFILTER_STATIC gstparse \
258          -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
259         > $@
260
261 if HAVE_INTROSPECTION
262 BUILT_GIRSOURCES = Gst-@GST_API_VERSION@.gir
263
264 gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@include_HEADERS))
265 gir_headers+=$(patsubst %,$(builddir)/%, $(built_header_make))
266 gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@_la_SOURCES))
267 gir_sources+=$(patsubst %,$(builddir)/%, $(built_source_make))
268
269 Gst-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_API_VERSION@.la
270         $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
271                 $(INTROSPECTION_SCANNER) -v --namespace Gst \
272                 --nsversion=@GST_API_VERSION@ \
273                 --warn-all \
274                 -I$(top_srcdir) \
275                 -I$(top_builddir) \
276                 -DIN_GOBJECT_INTROSPECTION=1 \
277                 --c-include='gst/gst.h' \
278                 --library=libgstreamer-@GST_API_VERSION@.la \
279                 --include=GLib-2.0 \
280                 --include=GObject-2.0 \
281                 --include=GModule-2.0 \
282                 --libtool="$(top_builddir)/libtool" \
283                 --pkg glib-2.0 \
284                 --pkg gobject-2.0 \
285                 --pkg gmodule-no-export-2.0 \
286                 --pkg-export gstreamer-@GST_API_VERSION@ \
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_API_VERSION)/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_API_VERSION)/gst-plugin-scanner"; \
314           exit 1; \
315         fi
316
317 all-local: check-libexecdir-consistency