summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-07-06 17:57:52 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-08-11 10:26:06 +0200
commitf88a7b7bec4da8dcb648baee70a9e01fc0572197 (patch)
treecbb7ab7451b788cb68a597a834aab522319f991b /common
parentc48b0a0672ccfbdfc67dc4a29eff97a57989f786 (diff)
Use installed spice-protocol for code generation
Now that spice-protocol ships the needed .proto files as well as the corresponding python scripts, spice-common can use these in order to generate the C code for the SPICE (de)marshallers.
Diffstat (limited to 'common')
-rw-r--r--common/Makefile.am52
1 files changed, 23 insertions, 29 deletions
diff --git a/common/Makefile.am b/common/Makefile.am
index b4384e8..2be512c 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -14,7 +14,7 @@ SERVER_MARSHALLERS = \
generated_server_marshallers.h \
$(NULL)
-BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
+BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
libspice_common_la_SOURCES = \
@@ -99,45 +99,39 @@ libspice_common_la_LIBADD = \
$(SPICE_COMMON_LIBS) \
$(NULL)
-MARSHALLERS_DEPS = \
- $(top_srcdir)/python_modules/__init__.py \
- $(top_srcdir)/python_modules/codegen.py \
- $(top_srcdir)/python_modules/demarshal.py \
- $(top_srcdir)/python_modules/marshal.py \
- $(top_srcdir)/python_modules/ptypes.py \
- $(top_srcdir)/python_modules/spice_parser.py \
- $(top_srcdir)/spice_codegen.py \
+MARSHALLERS_DEPS = \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/__init__.py \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/codegen.py \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/demarshal.py \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/marshal.py \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/ptypes.py \
+ $(CODE_GENERATOR_BASEDIR)/python_modules/spice_parser.py \
+ $(CODE_GENERATOR_BASEDIR)/spice_codegen.py \
$(NULL)
# Note despite being autogenerated these are not part of CLEANFILES, they are
# actually a part of EXTRA_DIST, to avoid the need for pyparser by end users
-generated_client_demarshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include common/messages.h $< $@ >/dev/null
+generated_client_demarshallers.c: $(CODE_GENERATOR_BASEDIR)/spice.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-demarshallers --client --include common/messages.h $< $@ >/dev/null
-generated_client_demarshallers1.c: $(top_srcdir)/spice1.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include common/messages.h --prefix 1 --ptrsize 8 $< $@ >/dev/null
+generated_client_demarshallers1.c: $(CODE_GENERATOR_BASEDIR)/spice1.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-demarshallers --client --include common/messages.h --prefix 1 --ptrsize 8 $< $@ >/dev/null
-generated_client_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client $< $@ >/dev/null
+generated_client_marshallers.c: $(CODE_GENERATOR_BASEDIR)/spice.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client $< $@ >/dev/null
-generated_client_marshallers1.c: $(top_srcdir)/spice1.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client --prefix 1 --ptrsize 8 $< $@ >/dev/null
+generated_client_marshallers1.c: $(CODE_GENERATOR_BASEDIR)/spice1.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client --prefix 1 --ptrsize 8 $< $@ >/dev/null
-generated_server_demarshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --server --include common/messages.h $< $@ >/dev/null
+generated_server_demarshallers.c: $(CODE_GENERATOR_BASEDIR)/spice.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-demarshallers --server --include common/messages.h $< $@ >/dev/null
STRUCTS = -M String -M Rect -M Point -M DisplayBase -M Fill -M Opaque -M Copy -M Blend -M Blackness -M Whiteness -M Invers -M Rop3 -M Stroke -M Text -M Transparent -M AlphaBlend -M Composite
-generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h $< $@ >/dev/null
+generated_server_marshallers.c: $(CODE_GENERATOR_BASEDIR)/spice.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h $< $@ >/dev/null
-generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h -H $< $@ >/dev/null
-
-# this is going to upset automake distcheck, since we try to write to
-# readonly srcdir. To limit the fail chances, rebuild automatically
-# enums.h only if the spice.proto has changed.
-$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto # $(MARSHALLERS_DEPS)
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
+generated_server_marshallers.h: $(CODE_GENERATOR_BASEDIR)/spice.proto $(MARSHALLERS_DEPS)
+ $(AM_V_GEN)$(PYTHON) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h -H $< $@ >/dev/null
EXTRA_DIST = \
$(CLIENT_MARSHALLERS) \