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