aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am.enum
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2009-10-16 12:59:39 -0500
committerTed Gould <ted@canonical.com>2009-10-16 12:59:39 -0500
commit8ad3fb0c2a9e0542235427f96f797c9bcf90d2b3 (patch)
treeb4ce13f024ea13bb3de08e3078de662c62d353c4 /Makefile.am.enum
parent1101075695054df49e96d815fec28b4e9ea0287a (diff)
downloadayatana-indicator-application-8ad3fb0c2a9e0542235427f96f797c9bcf90d2b3.tar.gz
ayatana-indicator-application-8ad3fb0c2a9e0542235427f96f797c9bcf90d2b3.tar.bz2
ayatana-indicator-application-8ad3fb0c2a9e0542235427f96f797c9bcf90d2b3.zip
Stealing these makefile segments to build enums and marshallers
Diffstat (limited to 'Makefile.am.enum')
-rw-r--r--Makefile.am.enum43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile.am.enum b/Makefile.am.enum
new file mode 100644
index 0000000..208dee3
--- /dev/null
+++ b/Makefile.am.enum
@@ -0,0 +1,43 @@
+# Rules for generating enumeration types using glib-mkenums
+#
+# Define:
+# glib_enum_h = header template file
+# glib_enum_c = source template file
+# glib_enum_headers = list of headers to parse
+#
+# before including Makefile.am.enums. You will also need to have
+# the following targets already defined:
+#
+# CLEANFILES
+# DISTCLEANFILES
+# BUILT_SOURCES
+# EXTRA_DIST
+#
+# Author: Emmanuele Bassi <ebassi@linux.intel.com>
+
+enum_tmpl_h=$(glib_enum_h:.h=.h.in)
+enum_tmpl_c=$(glib_enum_c:.c=.c.in)
+
+CLEANFILES += stamp-enum-types
+DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
+BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
+EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c)
+
+stamp-enum-types: $(glib_enum_headers)
+ $(QUIET_GEN)$(GLIB_MKENUMS) \
+ --template $(enum_tmpl_h) \
+ $(glib_enum_headers) > xgen-eh \
+ && (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \
+ && rm -f xgen-eh \
+ && echo timestamp > $(@F)
+
+$(glib_enum_h): stamp-enum-types
+ @true
+
+$(glib_enum_c): $(glib_enum_h)
+ $(QUIET_GEN)$(GLIB_MKENUMS) \
+ --template $(enum_tmpl_c) \
+ $(glib_enum_headers) > xgen-ec \
+ && cp -f xgen-ec $(glib_enum_c) \
+ && rm -f xgen-ec
+