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:
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user