2nd attempt to have a xml-less build as a joined effort of #413123 and #421480.
[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 gstparse.c gsttrace.c gstxml.c \
74         gstregistryxml.c gstregistrybinary.c
75
76
77 # temporarily not used
78 #       glib-compat.c
79
80 libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
81         gst.c                   \
82         gstobject.c             \
83         gstbin.c                \
84         gstbuffer.c             \
85         gstbus.c                \
86         gstcaps.c               \
87         gstchildproxy.c         \
88         gstclock.c              \
89         gstelement.c            \
90         gstelementfactory.c     \
91         gsterror.c              \
92         gstevent.c              \
93         gstfilter.c             \
94         gstformat.c             \
95         gstghostpad.c           \
96         $(GST_INDEX_SRC)        \
97         gstinfo.c               \
98         gstinterface.c          \
99         gstiterator.c           \
100         gstmessage.c            \
101         gstminiobject.c         \
102         gstpad.c                \
103         gstpadtemplate.c        \
104         gstpipeline.c           \
105         gstplugin.c             \
106         gstpluginfeature.c      \
107         gstquark.c              \
108         gstquery.c              \
109         gstregistry.c           \
110         gstsegment.c            \
111         gststructure.c          \
112         gstsystemclock.c        \
113         gsttaglist.c            \
114         gsttagsetter.c          \
115         gsttask.c               \
116         $(GST_TRACE_SRC)        \
117         gsttypefind.c           \
118         gsttypefindfactory.c    \
119         $(GST_URI_SRC)          \
120         gstutils.c              \
121         gstvalue.c              \
122         $(GST_PARSE_SRC)        \
123         $(GST_REGISTRY_SRC)     \
124         $(GST_LOADSAVE_SRC)
125
126 # do not put files in the distribution that are generated
127 nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
128
129 # BUILT_SOURCES are built on make all/check/install before all other targets
130 BUILT_SOURCES = \
131         $(built_header_configure)       \
132         $(built_header_make)            \
133         $(built_source_make)
134 # CLEANFILES is for files generated by make
135 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
136 # DISTCLEANFILES is for files generated by configure
137 DISTCLEANFILES = $(built_header_configure)
138
139 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =               \
140         -D_GNU_SOURCE                                   \
141         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
142         -DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\"        \
143         -DGST_DISABLE_DEPRECATED                        \
144         $(VALGRIND_CFLAGS)                              \
145         $(GST_ALL_CFLAGS)
146
147 libgstreamer_@GST_MAJORMINOR@_la_LIBADD =               \
148         $(GST_PARSE_LA)                                 \
149         $(GST_ALL_LIBS)                                 \
150         $(XML_LIBS)
151
152 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS =              \
153         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
154
155 libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst
156
157 gst_headers =                   \
158         gst.h                   \
159         glib-compat.h           \
160         gstobject.h             \
161         gstbin.h                \
162         gstbuffer.h             \
163         gstbus.h                \
164         gstcaps.h               \
165         gstchildproxy.h         \
166         gstclock.h              \
167         gstcompat.h             \
168         gstelement.h            \
169         gstelementfactory.h     \
170         gsterror.h              \
171         gstevent.h              \
172         gstfilter.h             \
173         gstformat.h             \
174         gstghostpad.h           \
175         gstindex.h              \
176         gstindexfactory.h       \
177         gstinfo.h               \
178         gstinterface.h          \
179         gstiterator.h           \
180         gstmacros.h             \
181         gstmessage.h            \
182         gstminiobject.h         \
183         gstpad.h                \
184         gstpadtemplate.h        \
185         gstpipeline.h           \
186         gstplugin.h             \
187         gstpluginfeature.h      \
188         gstquery.h              \
189         gstsegment.h            \
190         gststructure.h          \
191         gstsystemclock.h        \
192         gsttaglist.h            \
193         gsttagsetter.h          \
194         gsttask.h               \
195         gsttrace.h              \
196         gsttypefind.h           \
197         gsttypefindfactory.h    \
198         gsturi.h                \
199         gstutils.h              \
200         gstvalue.h              \
201         gstregistry.h           \
202         $(GST_PARSE_H)          \
203         gstxml.h
204
205 libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers)
206 nodist_libgstreamer_@GST_MAJORMINOR@include_HEADERS = \
207         $(built_header_configure) $(built_header_make)
208
209 EXTRA_DIST = \
210         gstparse.h
211
212 noinst_HEADERS =                \
213         gettext.h               \
214         glib-compat-private.h   \
215         gst-i18n-lib.h          \
216         gst-i18n-app.h          \
217         gstquark.h              \
218         gstregistrybinary.h     \
219         gst_private.h
220
221 gstmarshal.h: gstmarshal.list
222         glib-genmarshal --header --prefix=gst_marshal $(srcdir)/gstmarshal.list > gstmarshal.h.tmp
223         mv gstmarshal.h.tmp gstmarshal.h
224
225 gstmarshal.c: gstmarshal.list gst_private.h
226         echo "#include \"gst_private.h\"" > gstmarshal.c.tmp
227         echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp
228         echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp
229         glib-genmarshal --body --prefix=gst_marshal $(srcdir)/gstmarshal.list >> gstmarshal.c.tmp
230         mv gstmarshal.c.tmp gstmarshal.c
231
232 gstenumtypes.h: $(gst_headers)
233         glib-mkenums \
234         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
235         --fprod "\n/* enumerations from \"@filename@\" */\n" \
236         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
237         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
238         $^ > gstenumtypes.h
239
240 gstenumtypes.c: $(gst_headers)
241         glib-mkenums \
242         --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 " \
243         --fprod "\n/* enumerations from \"@filename@\" */" \
244         --vhead "static void\nregister_@enum_name@ (GType* id)\n{\n  static const G@Type@Value values[] = {"     \
245         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
246         --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" \
247         $^ > gstenumtypes.c
248
249 %.c.gcov: .libs/libgstreamer_@GST_MAJORMINOR@_la-%.gcda %.c
250         $(GCOV) -b -f -o $^ > $@.out
251
252 gcov: $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES:=.gcov)