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