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