2009-10-13 16:27:19 +00:00
|
|
|
# Rules for generating marshal files using glib-genmarshal
|
|
|
|
#
|
|
|
|
# Define:
|
|
|
|
# glib_marshal_list = marshal list file
|
|
|
|
# glib_marshal_prefix = prefix for marshal functions
|
|
|
|
#
|
|
|
|
# before including Makefile.am.marshal. 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_GENMARSHAL),,$(error Need to define GLIB_GENMARSHAL))
|
|
|
|
|
|
|
|
$(if $(or $(glib_marshal_list), \
|
|
|
|
$(glib_marshal_prefix)),, \
|
|
|
|
$(error Need to define glib_marshal_list and glib_marshal_prefix))
|
|
|
|
|
2009-10-13 16:27:19 +00:00
|
|
|
marshal_h = $(glib_marshal_list:.list=.h)
|
|
|
|
marshal_c = $(glib_marshal_list:.list=.c)
|
2010-09-07 13:47:59 +00:00
|
|
|
marshal_list = $(addprefix $(srcdir)/, $(glib_marshal_list))
|
2009-10-13 16:27:19 +00:00
|
|
|
|
|
|
|
CLEANFILES += stamp-marshal
|
|
|
|
DISTCLEANFILES += $(marshal_h) $(marshal_c)
|
|
|
|
BUILT_SOURCES += $(marshal_h) $(marshal_c)
|
2010-09-07 13:47:59 +00:00
|
|
|
EXTRA_DIST += $(marshal_list)
|
2009-10-13 16:27:19 +00:00
|
|
|
|
2010-09-07 13:47:59 +00:00
|
|
|
stamp-marshal: $(marshal_list)
|
|
|
|
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
|
2009-10-13 16:27:19 +00:00
|
|
|
--prefix=$(glib_marshal_prefix) \
|
|
|
|
--header \
|
2010-09-07 13:47:59 +00:00
|
|
|
$(marshal_list) > xgen-mh \
|
2009-10-13 16:27:19 +00:00
|
|
|
&& (cmp -s xgen-mh $(marshal_h) || cp -f xgen-mh $(marshal_h)) \
|
|
|
|
&& rm -f xgen-mh \
|
|
|
|
&& echo timestamp > $(@F)
|
|
|
|
|
|
|
|
$(marshal_h): stamp-marshal
|
|
|
|
@true
|
|
|
|
|
|
|
|
$(marshal_c): $(marshal_h)
|
2010-09-07 13:47:59 +00:00
|
|
|
$(AM_V_GEN)(echo "#include \"$(marshal_h)\"" ; \
|
2009-10-13 16:27:19 +00:00
|
|
|
$(GLIB_GENMARSHAL) \
|
|
|
|
--prefix=$(glib_marshal_prefix) \
|
|
|
|
--body \
|
2010-09-07 13:47:59 +00:00
|
|
|
$(marshal_list)) > xgen-mc \
|
2009-10-13 16:27:19 +00:00
|
|
|
&& cp xgen-mc $(marshal_c) \
|
|
|
|
&& rm -f xgen-mc
|