Drop libxml2 dependency when building with
[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 if USE_BINARY_REGISTRY
13 GST_REGISTRY_SRC = gstregistrybinary.c
14 else
15 GST_REGISTRY_SRC = gstregistryxml.c
16 endif
17 endif
18
19 if GST_DISABLE_PARSE
20 GST_PARSE_SRC = 
21 GST_PARSE_H = 
22 SUBDIRS_PARSE = 
23 GST_PARSE_LA = 
24 else
25 GST_PARSE_SRC = gstparse.c
26 GST_PARSE_H = gstparse.h
27 SUBDIRS_PARSE = parse
28 GST_PARSE_LA = parse/libgstparse.la 
29 endif
30
31 if GST_DISABLE_TRACE
32 GST_TRACE_SRC = 
33 else
34 GST_TRACE_SRC = gsttrace.c
35 endif
36
37 if GST_DISABLE_ENUMTYPES
38 GST_ENUMTYPES_SRC = 
39 else
40 GST_ENUMTYPES_SRC = gstenumtypes.c
41 endif
42
43 if GST_DISABLE_INDEX
44 GST_INDEX_SRC = 
45 else
46 GST_INDEX_SRC = gstindex.c gstindexfactory.c
47 endif
48
49 if GST_DISABLE_PLUGIN
50 GST_PLUGIN_SRC = 
51 else
52 GST_PLUGIN_SRC = gstplugin.c
53 endif
54
55 if GST_DISABLE_URI
56 GST_URI_SRC = 
57 else
58 GST_URI_SRC = gsturi.c
59 endif
60
61 SUBDIRS = $(SUBDIRS_PARSE)
62
63 DIST_SUBDIRS = parse
64
65 # make variables for all generated source and header files to make the
66 # distinction clear
67                                                                                 
68 built_header_configure = gstconfig.h gstversion.h
69 built_header_make = gstenumtypes.h gstmarshal.h
70 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
71
72 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
73         gstmarshal.list gstxml.c gstparse.c gsttrace.c gstregistryxml.c
74
75
76 # temporarily not used
77 #       glib-compat.c
78
79 libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
80         gst.c                   \
81         gstobject.c             \
82         gstbin.c                \
83         gstbuffer.c             \
84         gstbus.c                \
85         gstcaps.c               \
86         gstchildproxy.c         \
87         gstclock.c              \
88         gstelement.c            \
89         gstelementfactory.c     \
90         gsterror.c              \
91         gstevent.c              \
92         gstfilter.c             \
93         gstformat.c             \
94         gstghostpad.c           \
95         $(GST_INDEX_SRC)        \
96         gstinfo.c               \
97         gstinterface.c          \
98         gstiterator.c           \
99         gstmessage.c            \
100         gstminiobject.c         \
101         gstpad.c                \
102         gstpadtemplate.c        \
103         gstpipeline.c           \
104         gstplugin.c             \
105         gstpluginfeature.c      \
106         gstquark.c              \
107         gstquery.c              \
108         gstregistry.c           \
109         gstsegment.c            \
110         gststructure.c          \
111         gstsystemclock.c        \
112         gsttaglist.c            \
113         gsttagsetter.c          \
114         gsttask.c               \
115         $(GST_TRACE_SRC)        \
116         gsttypefind.c           \
117         gsttypefindfactory.c    \
118         $(GST_URI_SRC)          \
119         gstutils.c              \
120         gstvalue.c              \
121         $(GST_PARSE_SRC)        \
122         $(GST_REGISTRY_SRC)     \
123         $(GST_LOADSAVE_SRC)
124
125 # do not put files in the distribution that are generated
126 nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
127
128 # BUILT_SOURCES are built on make all/check/install before all other targets
129 BUILT_SOURCES = \
130         $(built_header_configure)       \
131         $(built_header_make)            \
132         $(built_source_make)
133 # CLEANFILES is for files generated by make
134 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
135 # DISTCLEANFILES is for files generated by configure
136 DISTCLEANFILES = $(built_header_configure)
137                                                                                 
138 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =               \
139         -D_GNU_SOURCE                                   \
140         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
141         -DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\"        \
142         -DGST_DISABLE_DEPRECATED                        \
143         $(VALGRIND_CFLAGS)                              \
144         $(GST_ALL_CFLAGS)
145
146 libgstreamer_@GST_MAJORMINOR@_la_LIBADD =               \
147         $(GST_PARSE_LA)                                 \
148         $(GST_ALL_LIBS)                                 \
149         $(XML_LIBS)
150
151 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS =              \
152         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
153
154 libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst
155
156 gst_headers =                   \
157         gst.h                   \
158         glib-compat.h           \
159         gstobject.h             \
160         gstbin.h                \
161         gstbuffer.h             \
162         gstbus.h                \
163         gstcaps.h               \
164         gstchildproxy.h         \
165         gstclock.h              \
166         gstcompat.h             \
167         gstelement.h            \
168         gstelementfactory.h     \
169         gsterror.h              \
170         gstevent.h              \
171         gstfilter.h             \
172         gstformat.h             \
173         gstghostpad.h           \
174         gstindex.h              \
175         gstindexfactory.h       \
176         gstinfo.h               \
177         gstinterface.h          \
178         gstiterator.h           \
179         gstmacros.h             \
180         gstmessage.h            \
181         gstminiobject.h         \
182         gstpad.h                \
183         gstpadtemplate.h        \
184         gstpipeline.h           \
185         gstplugin.h             \
186         gstpluginfeature.h      \
187         gstquery.h              \
188         gstsegment.h            \
189         gststructure.h          \
190         gstsystemclock.h        \
191         gsttaglist.h            \
192         gsttagsetter.h          \
193         gsttask.h               \
194         gsttrace.h              \
195         gsttypefind.h           \
196         gsttypefindfactory.h    \
197         gsturi.h                \
198         gstutils.h              \
199         gstvalue.h              \
200         gstregistry.h           \
201         $(GST_PARSE_H)          \
202         gstxml.h
203
204 libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers)
205 nodist_libgstreamer_@GST_MAJORMINOR@include_HEADERS = \
206         $(built_header_configure) $(built_header_make)
207
208 EXTRA_DIST = \
209         gstparse.h
210
211 noinst_HEADERS =                \
212         gettext.h               \
213         glib-compat-private.h   \
214         gst-i18n-lib.h          \
215         gst-i18n-app.h          \
216         gstquark.h              \
217         gstregistrybinary.h     \
218         gst_private.h
219
220 gstmarshal.h: gstmarshal.list
221         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         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         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         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 "static void\nregister_@enum_name@ (GType* id)\n{\n  static const G@Type@Value values[] = {"     \
244         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
245         --vtail "    { 0, NULL, NULL }\n  };\n  *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n  static GType id;\n  static GOnce once = G_ONCE_INIT;\n\n  g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n  return id;\n}\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)