Use newer glib-genmarshal to simplify build rules

The glib-genmarshal tool from GLib 2.54 added various command line
arguments that allow us to remove a bunch of as hoc manipulations of
the generated marshaller source files. The marshal generator tool can
now include an header in the source, and undef the G_ENABLE_DEBUG
pre-processor symbol for us. It can also generate the prototypes of the
marshallers in the C source, and avoid a 'missing-prototypes' compiler
warning.
This commit is contained in:
Emmanuele Bassi
2017-07-11 11:39:59 +01:00
parent 013392b530
commit ce861bc430
2 changed files with 9 additions and 6 deletions

View File

@@ -426,6 +426,7 @@ gdkmarshalers.c: gdkmarshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) \
--prefix=_gdk_marshal \
--body \
--prototypes \
$(srcdir)/gdkmarshalers.list > gdkmarshalers-c.tmp \
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
|| ( rm -f gdkmarshalers-c.tmp && exit 1 )

View File

@@ -1196,19 +1196,21 @@ gtkmarshalers.h: stamp-gtkmarshalers.h
@true
stamp-gtkmarshalers.h: gtkmarshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) \
--prefix=_gtk_marshal \
--header \
--prefix=_gtk_marshal \
--valist-marshallers \
$(srcdir)/gtkmarshalers.list >> xgen-gmlh \
$(srcdir)/gtkmarshalers.list > xgen-gmlh \
&& (cmp -s xgen-gmlh gtkmarshalers.h || cp xgen-gmlh gtkmarshalers.h) \
&& rm -f xgen-gmlh \
&& echo timestamp > $(@F)
gtkmarshalers.c: gtkmarshalers.list
$(AM_V_GEN) (echo "#undef G_ENABLE_DEBUG"; \
$(GLIB_GENMARSHAL) \
--prefix=_gtk_marshal \
$(AM_V_GEN) $(GLIB_GENMARSHAL) \
--body \
--valist-marshallers $(srcdir)/gtkmarshalers.list) >> xgen-gmlc \
--prefix=_gtk_marshal \
--valist-marshallers \
--include-header="gtkmarshalers.h" \
-U G_ENABLE_DEBUG \
$(srcdir)/gtkmarshalers.list > xgen-gmlc \
&& cp xgen-gmlc gtkmarshalers.c \
&& rm -f xgen-gmlc