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