Rest of the fix for 316155: don't confuse MinGW when running glib-mkenums
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_MAJORMINOR@.la
2
3 if HAVE_CHECK
4 SUBDIRS_CHECK = check
5 else
6 SUBDIRS_CHECK =
7 endif
8
9 if GST_DISABLE_LOADSAVE
10 GST_LOADSAVE_SRC = 
11 else
12 GST_LOADSAVE_SRC = gstxml.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_REGISTRY
32 GST_REGISTRY_SRC = 
33 SUBDIRS_REGISTRY =
34 GST_REGISTRY_LA = 
35 else
36 GST_REGISTRY_SRC = gstregistry.c
37 SUBDIRS_REGISTRY = registries
38 GST_REGISTRY_LA = registries/libgstxmlregistry.la
39 endif
40
41 if GST_DISABLE_ENUMTYPES
42 GST_ENUMTYPES_SRC = 
43 else
44 GST_ENUMTYPES_SRC = gstenumtypes.c
45 endif
46
47 if GST_DISABLE_INDEX
48 GST_INDEX_SRC = 
49 SUBDIRS_INDEX =
50 else
51 GST_INDEX_SRC = gstindex.c
52 SUBDIRS_INDEX = indexers
53 endif
54
55 if GST_DISABLE_PLUGIN
56 GST_PLUGIN_SRC = 
57 else
58 GST_PLUGIN_SRC = gstplugin.c
59 endif
60
61 if GST_DISABLE_URI
62 GST_URI_SRC = 
63 else
64 GST_URI_SRC = gsturi.c
65 endif
66
67 SUBDIRS = $(SUBDIRS_PARSE) $(SUBDIRS_REGISTRY) . base elements $(SUBDIRS_INDEX) $(SUBDIRS_CHECK)
68 DIST_SUBDIRS = base elements parse registries indexers check
69
70 # make variables for all generated source and header files to make the
71 # distinction clear
72                                                                                 
73 built_header_configure = gstconfig.h gstversion.h
74 built_header_make = gstenumtypes.h gstmarshal.h
75 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
76
77 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
78         gstmarshal.list gstxml.c gstparse.c gsttrace.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         gstmemchunk.c           \
101         gstmessage.c            \
102         gstminiobject.c         \
103         gstpad.c                \
104         gstpipeline.c           \
105         gstplugin.c             \
106         gstpluginfeature.c      \
107         gstquery.c              \
108         gstqueryutils.c         \
109         gstqueue.c              \
110         gststructure.c          \
111         gstsystemclock.c        \
112         gsttaglist.c            \
113         gsttagsetter.c  \
114         gsttask.c               \
115         $(GST_TRACE_SRC)        \
116         gsttrashstack.c         \
117         gsttypefind.c           \
118         gsttypefindfactory.c    \
119         $(GST_URI_SRC)          \
120         gsturitype.c            \
121         gstutils.c              \
122         gstvalue.c              \
123         $(GST_REGISTRY_SRC)     \
124         gstregistrypool.c       \
125         $(GST_PARSE_SRC)        \
126         $(GSTARCH_SRCS)         \
127         $(GST_LOADSAVE_SRC)
128
129 # do not put files in the distribution that are generated
130 nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
131
132 # BUILT_SOURCES are built on make all/check/install before all other targets
133 BUILT_SOURCES = \
134         $(built_header_configure)       \
135         $(built_header_make)            \
136         $(built_source_make)
137 # CLEANFILES is for files generated by make
138 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles)
139 # DISTCLEANFILES is for files generated by configure
140 DISTCLEANFILES = $(built_header_configure)
141                                                                                 
142 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =       \
143         -D_GNU_SOURCE                           \
144         $(GST_LIB_CFLAGS)                       \
145         -DG_LOG_DOMAIN=g_log_domain_gstreamer   \
146         -DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\" 
147 libgstreamer_@GST_MAJORMINOR@_la_LIBADD = \
148         $(GST_LIB_LIBS) $(GST_PARSE_LA) $(GST_REGISTRY_LA)
149 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS = \
150         @GST_LT_LDFLAGS@ -version-info @GST_LIBVERSION@ \
151         -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*
152
153 libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst
154
155 gst_headers =                   \
156         gst.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         gstinfo.h               \
174         gstinterface.h          \
175         gstiterator.h           \
176         gstmacros.h             \
177         gstmemchunk.h           \
178         gstmessage.h            \
179         gstminiobject.h         \
180         gstpad.h                \
181         gstpipeline.h           \
182         gstplugin.h             \
183         gstpluginfeature.h      \
184         gstquery.h              \
185         gstqueryutils.h         \
186         gstqueue.h              \
187         gststructure.h          \
188         gstsystemclock.h        \
189         gsttaglist.h            \
190         gsttagsetter.h  \
191         gsttask.h               \
192         gsttrace.h              \
193         gsttrashstack.h         \
194         gsttypefind.h           \
195         gsttypefindfactory.h    \
196         gsturi.h                \
197         gsturitype.h            \
198         gstutils.h              \
199         gstvalue.h              \
200         gstregistry.h           \
201         gstregistrypool.h       \
202         gstparse.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 noinst_HEADERS =                \
210         gettext.h               \
211         gst-i18n-lib.h          \
212         gst-i18n-app.h          \
213         gst_private.h
214
215 gstmarshal.h: gstmarshal.list
216         glib-genmarshal --header --prefix=gst_marshal $(srcdir)/gstmarshal.list > gstmarshal.h.tmp
217         mv gstmarshal.h.tmp gstmarshal.h
218
219 gstmarshal.c: gstmarshal.list gst_private.h
220         echo "#include \"gst_private.h\"" > gstmarshal.c.tmp
221         echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp
222         echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp
223         glib-genmarshal --body --prefix=gst_marshal $(srcdir)/gstmarshal.list >> gstmarshal.c.tmp
224         mv gstmarshal.c.tmp gstmarshal.c
225
226 gstenumtypes.h: $(gst_headers)
227         glib-mkenums \
228         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
229         --fprod "\n/* enumerations from \"@filename@\" */\n" \
230         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
231         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
232         $^ > gstenumtypes.h
233
234 gstenumtypes.c: $(gst_headers)
235         glib-mkenums \
236         --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>" \
237         --fprod "\n/* enumerations from \"@filename@\" */" \
238         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
239         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
240         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
241         $^ > gstenumtypes.c