mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 09:00:42 -05:00
41e22ab592
When building against a glib-genmarshal from GLib 2.54 we can use the `--prototypes` command line argument to generate the prototypes for the marshallers in the C source, and avoid a missing-prototypes compiler warning.
55 lines
1.5 KiB
Makefile
55 lines
1.5 KiB
Makefile
# 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>
|
|
|
|
# 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))
|
|
|
|
marshal_h = $(glib_marshal_list:.list=.h)
|
|
marshal_c = $(glib_marshal_list:.list=.c)
|
|
marshal_list = $(addprefix $(srcdir)/, $(glib_marshal_list))
|
|
|
|
CLEANFILES += stamp-marshal
|
|
DISTCLEANFILES += $(marshal_h) $(marshal_c)
|
|
BUILT_SOURCES += $(marshal_h) $(marshal_c)
|
|
EXTRA_DIST += $(marshal_list)
|
|
|
|
stamp-marshal: $(marshal_list)
|
|
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
|
|
--prefix=$(glib_marshal_prefix) \
|
|
--header \
|
|
--valist-marshallers \
|
|
$(marshal_list) > xgen-mh \
|
|
&& (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)
|
|
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
|
|
--prefix=$(glib_marshal_prefix) \
|
|
--body \
|
|
--valist-marshallers \
|
|
--prototypes \
|
|
$(marshal_list) > xgen-mc \
|
|
&& (cmp -s xgen-mc $(marshal_c) || cp -f xgen-mc $(marshal_c)) \
|
|
&& rm -f xgen-mc
|