build: Rename spice-server-enums.tmpl.[ch] to spice-server-enums.[ch].tmpl

This is a preparation for meson build, which has built-in support for
generating enums, but requires the template files to be renamed. It uses
the basename of template files to generate the output, and in this case
it would be the same file for both '.c' and '.h'. Ideally meson would
let us specify the name of the output files, but this is not the case.

Without renaming, the following error happens:

Meson encountered an error in file server/meson.build, line 30, column 0:
Tried to create target "spice-server-enums.tmpl", but a target of that
name already exists.

Reference: http://mesonbuild.com/Gnome-module.html#gnomemkenums

Note that by the time of this commit, the documentation is not accurate
and does not mention the fact that output files will get the base name
of the template files if they are specified, I submitted a pull request
to meson fixing this detail in docs:

   https://github.com/mesonbuild/meson/pull/3191

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Eduardo Lima (Etrunko) 2018-03-06 11:12:58 -03:00
parent e45e087617
commit dafc941c76
3 changed files with 6 additions and 6 deletions

View File

@ -205,11 +205,11 @@ endif
libspice_server_la_LIBADD = libserver.la
libspice_server_la_SOURCES =
spice-server-enums.c: spice-server.h spice-server-enums.tmpl.c
$(AM_V_GEN)glib-mkenums --template $(srcdir)/spice-server-enums.tmpl.c $< > $@
spice-server-enums.c: spice-server.h spice-server-enums.c.tmpl
$(AM_V_GEN)glib-mkenums --template $(srcdir)/spice-server-enums.c.tmpl $< > $@
spice-server-enums.h: spice-server.h spice-server-enums.tmpl.h
$(AM_V_GEN)glib-mkenums --template $(srcdir)/spice-server-enums.tmpl.h $< > $@
spice-server-enums.h: spice-server.h spice-server-enums.h.tmpl
$(AM_V_GEN)glib-mkenums --template $(srcdir)/spice-server-enums.h.tmpl $< > $@
EXTRA_DIST = \
spice-bitmap-utils.tmpl.c \
@ -217,8 +217,8 @@ EXTRA_DIST = \
glz-encode-match.tmpl.c \
glz-encode.tmpl.c \
spice-server.syms \
spice-server-enums.tmpl.h \
spice-server-enums.tmpl.c \
spice-server-enums.h.tmpl \
spice-server-enums.c.tmpl \
$(NULL)
BUILT_SOURCES = $(spice_built_sources)