2009-10-13 16:27:19 +00:00
|
|
|
# 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>
|
|
|
|
|
2010-09-07 13:47:59 +00:00
|
|
|
# Basic sanity checks
|
|
|
|
$(if $(GLIB_MKENUMS),,$(error Need to define GLIB_MKENUMS))
|
|
|
|
|
|
|
|
$(if $(or $(glib_enum_h), \
|
|
|
|
$(glib_enum_c)),, \
|
|
|
|
$(error Need to define glib_enum_h and glib_enum_c))
|
|
|
|
|
|
|
|
$(if $(glib_enum_headers),,$(error Need to define glib_enum_headers))
|
|
|
|
|
|
|
|
enum_tmpl_h=$(addprefix $(srcdir)/, $(glib_enum_h:.h=.h.in))
|
|
|
|
enum_tmpl_c=$(addprefix $(srcdir)/, $(glib_enum_c:.c=.c.in))
|
2009-10-13 16:27:19 +00:00
|
|
|
|
|
|
|
CLEANFILES += stamp-enum-types
|
|
|
|
DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
|
|
|
|
BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
|
2010-09-07 13:47:59 +00:00
|
|
|
EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c)
|
2009-10-13 16:27:19 +00:00
|
|
|
|
2010-09-07 13:47:59 +00:00
|
|
|
stamp-enum-types: $(glib_enum_headers) $(enum_tmpl_h)
|
|
|
|
$(AM_V_GEN)$(GLIB_MKENUMS) \
|
|
|
|
--template $(enum_tmpl_h) \
|
2009-10-13 16:27:19 +00:00
|
|
|
$(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
|
|
|
|
|
2010-09-07 13:47:59 +00:00
|
|
|
$(glib_enum_c): $(glib_enum_headers) $(glib_enum_h) $(enum_tmpl_c)
|
2010-09-07 14:23:35 +00:00
|
|
|
$(AM_V_GEN)$(GLIB_MKENUMS) \
|
2010-09-07 13:47:59 +00:00
|
|
|
--template $(enum_tmpl_c) \
|
2009-10-13 16:27:19 +00:00
|
|
|
$(glib_enum_headers) > xgen-ec \
|
|
|
|
&& cp -f xgen-ec $(glib_enum_c) \
|
|
|
|
&& rm -f xgen-ec
|