gst-libs/gst/: Generate enum type code with glib-mkenums.
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / mixer / Makefile.am
1 libgstmixerincludedir = \
2         $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/mixer
3
4 mixer_headers = \
5         mixer.h \
6         mixertrack.h
7
8 built_headers = \
9         mixermarshal.h \
10         mixerenumtypes.h
11
12 libgstmixerinclude_HEADERS = $(mixer_headers) $(built_headers)
13
14 noinst_LTLIBRARIES = libgstmixer.la
15
16 libgstmixer_la_SOURCES = \
17         mixer.c \
18         mixertrack.c \
19         mixermarshal.c \
20         mixerenumtypes.c
21 libgstmixer_la_CFLAGS = $(GST_CFLAGS)
22
23 BUILT_SOURCES = \
24         mixermarshal.c \
25         mixermarshal.h \
26         mixerenumtypes.c \
27         mixerenumtypes.h
28
29 EXTRA_DIST = mixermarshal.list
30
31 CLEANFILES = $(BUILT_SOURCES)
32
33 mixermarshal.h: mixermarshal.list
34         glib-genmarshal --header --prefix=gst_mixer_marshal $^ > mixermarshal.h.tmp
35         mv mixermarshal.h.tmp mixermarshal.h
36
37 mixermarshal.c: mixermarshal.list
38         echo "#include \"mixermarshal.h\"" >> mixermarshal.c.tmp
39         glib-genmarshal --body --prefix=gst_mixer_marshal $^ >> mixermarshal.c.tmp
40         mv mixermarshal.c.tmp mixermarshal.c
41
42 mixerenumtypes.h: $(mixer_headers)
43         glib-mkenums \
44         --fhead "#ifndef __GST_MIXER_ENUM_TYPES_H__\n#define __GST_MIXER_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
45         --fprod "/* enumerations from \"@filename@\" */\n" \
46         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
47         --ftail "G_END_DECLS\n\n#endif /* __GST_MIXER_ENUM_TYPES_H__ */" \
48         $^ > $@
49
50 mixerenumtypes.c: $(mixer_headers)
51         glib-mkenums \
52         --fhead "#include <mixer.h>" \
53         --fprod "\n/* enumerations from \"@filename@\" */" \
54         --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[] = {"     \
55         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
56         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
57         $^ > $@