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