aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-27 19:54:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-08-27 20:07:52 +0800
commitaa3b6c57a51dbd64af2371fd7a218231a3a56b19 (patch)
tree48aa0914a6f7507a93271133cb2653e6b4538bb7
parentf4eeac9d196423591309b872672657c1e4902d70 (diff)
downloadgsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar.gz
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar.bz2
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar.lz
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar.xz
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.tar.zst
gsoc2013-evolution-aa3b6c57a51dbd64af2371fd7a218231a3a56b19.zip
Fix enum generation problems in glib-gen.mak.
Don't use pattern rules like %-enumtypes.h anymore because it matches installed header files like camel-enumtypes.h, so you get very strange things happening during the build like: .../camel/camel-enumtypes.h: e-util-enums.h glib-mkenums ... $^ > $@ when e-util-enums.h has a newer timestamp than camel-enumtypes.h. Instead, we'll use another variable name -- glib_enum_output -- to replace the %-enumtypes pattern rules like so: $(glib_enum_output).h: $(glib_enum_headers) glib-mkenums ... $^ > $@ $(glib_enum_output).c: $(glib_enum_headers) glib-mkenums ... $^ > $@ Also use $(AM_V_GEN) to get cleaner looking output while building.
-rw-r--r--e-util/Makefile.am1
-rw-r--r--glib-gen.mak19
-rw-r--r--mail/Makefile.am1
3 files changed, 12 insertions, 9 deletions
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 83452013a8..53614e3b06 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -4,6 +4,7 @@ ruledir = $(privdatadir)
include $(top_srcdir)/glib-gen.mak
glib_enum_headers=e-util-enums.h
+glib_enum_output=e-util-enumtypes
glib_enum_define=E
glib_enum_prefix=e
diff --git a/glib-gen.mak b/glib-gen.mak
index f510d80b17..a360dde048 100644
--- a/glib-gen.mak
+++ b/glib-gen.mak
@@ -2,31 +2,32 @@
# the example is based on the colorbalance interface
#glib_enum_headers=$(colorbalance_headers)
+#glib_enum_output=gst-color-balance-enumtypes
#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
+ $(AM_V_GEN) 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
+ $(AM_V_GEN) 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 \
+$(glib_enum_output).h: $(glib_enum_headers)
+ $(AM_V_GEN) 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)
+$(glib_enum_output).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\"" \
+ $(AM_V_GEN) glib-mkenums \
+ --fhead "#include <$<>\n#include \"$(glib_enum_output).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@\", \"@valuenick@\" }," \
@@ -38,5 +39,5 @@
.deps/%-marshal.Plo:
touch $@
-.deps/%-enumtypes.Plo:
+.deps/$(glib_enum_output).Plo:
touch $@
diff --git a/mail/Makefile.am b/mail/Makefile.am
index 0d2864d59f..97a2fe39a4 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -6,6 +6,7 @@ mailincludedir = $(privincludedir)/mail
include $(top_srcdir)/glib-gen.mak
glib_enum_headers=e-mail-enums.h
+glib_enum_output=e-mail-enumtypes
glib_enum_define=E_MAIL
glib_enum_prefix=e_mail