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