Commit d09943cc authored by Colomban Wendling's avatar Colomban Wendling

OVCCGtk: fix portability of our custom Make targets

Make variable "$<" in non-suffix rules is a GNU Make extension, so
switch to suffix rules.

Additionally, make the rules a little more generic by extracting custom
flags to a _FLAGS variable.
parent 9ae08cfe
......@@ -48,20 +48,34 @@ ovcc_gtk_SOURCES = $(autogen_sources) \
$(headers)
ovccgtk-marshal.h: $(srcdir)/ovccgtk-marshal.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=ovccgtk_marshal > $@
GLIB_GENMARSHAL_FLAGS = --prefix=ovccgtk_marshal
ovccgtk-marshal.c: $(srcdir)/ovccgtk-marshal.list ovccgtk-marshal.h
$(AM_V_GEN) echo '#include "ovccgtk-marshal.h"' > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=ovccgtk_marshal >> $@
SUFFIXES = .list .c.tpl .h.tpl .c .h
.list.h:
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header $(GLIB_GENMARSHAL_FLAGS) > $@
.list.c:
$(AM_V_GEN) ( echo '#include "$@"' | $(SED) 's/.c"/.h"/' && \
$(GLIB_GENMARSHAL) $< --body $(GLIB_GENMARSHAL_FLAGS) ) > $@
# we need to hack since our prefix (OVCCGtk) is incorrectly detected as mapping
# to prefix=o sub-prefix=vcc_gtk
ovccgtk-enum-types.c: $(srcdir)/ovccgtk-enum-types.c.tpl ovccgtk-enum-types.h $(headers) Makefile
.c.tpl.c:
$(AM_V_GEN)$(GLIB_MKENUMS) --template $< $(headers:%=$(srcdir)/%) | \
$(SED) s%o_vcc_gtk_%ovccgtk_%g | \
$(SED) s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g > $@
ovccgtk-enum-types.h: $(srcdir)/ovccgtk-enum-types.h.tpl $(headers) Makefile
.h.tpl.h:
$(AM_V_GEN)$(GLIB_MKENUMS) --template $< $(headers:%=$(srcdir)/%) | \
$(SED) s%o_vcc_gtk_%ovccgtk_%g | \
$(SED) s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g > $@
# explicit dependencies of our generated files
$(autogen_headers) $(autogen_sources): Makefile
ovccgtk-marshal.c: ovccgtk-marshal.h
ovccgtk-enum-types.c: ovccgtk-enum-types.h $(headers)
ovccgtk-enum-types.h: $(headers)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment