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