~ubuntu-branches/ubuntu/precise/evolution-data-server/precise-proposed

« back to all changes in this revision

Viewing changes to camel/glib-gen.mak

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-07-27 11:45:30 UTC
  • mfrom: (1.1.90 upstream)
  • Revision ID: james.westby@ubuntu.com-20110727114530-v4ntbu728os68b0b
Tags: 3.1.4-0ubuntu1
* New upstream version.
* debian/patches/999git_EDS_3_1_3_1_to_f94a069.patch: drop, included in
  the upstream 3.1.4 tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# these are the variables your Makefile.am should set
 
2
# the example is based on the colorbalance interface
 
3
 
 
4
#glib_enum_headers=$(colorbalance_headers)
 
5
#glib_enum_define=GST_COLOR_BALANCE
 
6
#glib_enum_prefix=gst_color_balance
 
7
 
 
8
# these are all the rules generating the relevant files
 
9
%-marshal.h: %-marshal.list
 
10
        $(AM_V_GEN) glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp && \
 
11
        mv $*-marshal.h.tmp $*-marshal.h
 
12
 
 
13
%-marshal.c: %-marshal.list
 
14
        $(AM_V_GEN) echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp && \
 
15
        glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \
 
16
        mv $*-marshal.c.tmp $*-marshal.c
 
17
 
 
18
%-enumtypes.h: $(glib_enum_headers)
 
19
        $(AM_V_GEN) glib-mkenums \
 
20
        --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
 
21
        --fprod "/* enumerations from \"@filename@\" */\n" \
 
22
        --vhead "GType @enum_name@_get_type (void);\n#define CAMEL_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
 
23
        --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
 
24
        $^ > $@
 
25
 
 
26
%-enumtypes.c: $(glib_enum_headers)
 
27
        @if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
 
28
        $(AM_V_GEN) glib-mkenums \
 
29
        --fhead "#include <$*.h>\n#include \"$*-enumtypes.h\"" \
 
30
        --fprod "\n/* enumerations from \"@filename@\" */" \
 
31
        --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[] = {"     \
 
32
        --vprod "      { @valuenum@, \"@VALUENAME@\", \"@valuenick@\" }," \
 
33
        --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
 
34
        $^ > $@
 
35
 
 
36
# a hack rule to make sure .Plo files exist because they get include'd
 
37
# from Makefile's
 
38
.deps/%-marshal.Plo:
 
39
        touch $@
 
40
 
 
41
.deps/%-enumtypes.Plo:
 
42
        touch $@