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