aboutsummaryrefslogtreecommitdiffstats
path: root/glib-gen.mak
blob: 7aae596e15281d9db274ff2e852e32c91dd696ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# these are the variables your Makefile.am should set
# the example is based on the colorbalance interface

#glib_enum_headers=$(colorbalance_headers)
#glib_enum_define=GST_COLOR_BALANCE
#glib_enum_prefix=gst_color_balance

# these are all the rules generating the relevant files
%-marshal.h: %-marshal.list
    glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp
    mv $*-marshal.h.tmp $*-marshal.h

%-marshal.c: %-marshal.list
    echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp
    glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp
    mv $*-marshal.c.tmp $*-marshal.c

%-enumtypes.h: $(glib_enum_headers)
    glib-mkenums \
    --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" \
    --fprod "/* enumerations from \"@filename@\" */\n" \
    --vhead "GType @enum_name@_get_type (void);\n#define E_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
    --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
    $^ > $@

%-enumtypes.c: $(glib_enum_headers)
    @if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
    glib-mkenums \
    --fhead "#include <$*.h>\n#include \"$*-enumtypes.h\"" \
    --fprod "\n/* enumerations from \"@filename@\" */" \
    --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[] = {"     \
    --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@VALUENAME@\" }," \
    --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
    $^ > $@

# a hack rule to make sure .Plo files exist because they get include'd
# from Makefile's
.deps/%-marshal.Plo:
    touch $@

.deps/%-enumtypes.Plo:
    touch $@
inimon2007-09-082-14/+0 * - Welcome X.org 7.2 \o/.flz2007-05-201-1/+1 * Fix the gtk2 dnd implementation broken, see more details in the bugzilla. Thismezz2007-01-192-1/+20 * - Build and install the css editor extensionahze2006-11-201-1/+2 * Chase the GNOME X11BASE to LOCALBASE move, and fix the build with themarcus2006-10-141-5/+3 * - Fix build with new gmakeahze2006-07-101-0/+30 * Transfer maintainer to gnome@ to be with all other gecko portsahze2006-07-061-1/+1 * - Welcome back sparc64 on kern.osreldate>=601101ahze2006-07-061-1/+5 * - Convert nvu to generic pkg-[de]install scriptahze2006-04-172-59/+0 * Correct typoskris2006-03-261-1/+1 * - s/alpha/sparc64/ s/IGNORE/BROKEN/ahze2006-03-261-2/+2 * - Mark IGNORE on sparc64 & ia64ahze2006-03-261-0/+4 * - Attempt to fix build on sparc64ahze2006-02-191-0/+23 * - Fix buildahze2005-12-301-0/+30 * - Fix build in tinderboxahze2005-12-091-0/+1 * Fix all those ports to find libnssckbi.so in the correct place to allow thosemezz2005-12-021-0/+1 * - Use new Makefile.common from mozillaahze2005-11-3014-340/+246 * - Add SHA256ahze2005-11-091-0/+1 * - Fix build when ${X11BASE}!=/usr/X11R6ahze2005-10-271-1/+2 * - Update to 1.0ahze2005-06-293-30/+14 * - Update to 1.0PRahze2005-04-152-8/+18 * Bump PORTREVISION to chase the glib20 shared lib version change.marcus2005-03-121-0/+1 * - Update to 0.90ahze2005-03-122-9/+7 * - Update to 0.9rc1ahze2005-03-103-6/+350 * - Update to 0.81ahze2005-02-122-5/+4 * - Update to 0.80 (aka 1.0 beta3)ahze2005-02-022-7/+5 * - Remove forgotten conflicting patch.ahze2005-01-142-64/+36 * Fix patch so it works.ahze2005-01-131-36/+8 * Attempt to fix build on amd64ahze2005-01-121-0/+56 * Fix build by re-adding config optionsahze2005-01-121-0/+1 * - Remove un-needed configure optionsahze2005-01-101-2/+1 * Remove libmng from LIB_DEPENDS since it doesn't work.ahze2005-01-101-1/+0