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