[CRIU] [PATCH 2/9] protobuf: generate python modules

Pavel Emelyanov xemul at parallels.com
Wed Oct 8 08:58:38 PDT 2014


On 10/08/2014 02:35 PM, Ruslan Kuprieiev wrote:
> Lets generate them right after generating c files, because
> they have the same *.proto dependencies and adding separate
> target whould only mess up everything.
> 
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>  protobuf/.gitignore | 4 ++++
>  protobuf/Makefile   | 3 +++
>  2 files changed, 7 insertions(+)
>  create mode 100644 protobuf/.gitignore
> 
> diff --git a/protobuf/.gitignore b/protobuf/.gitignore
> new file mode 100644
> index 0000000..5232c2a
> --- /dev/null
> +++ b/protobuf/.gitignore
> @@ -0,0 +1,4 @@
> +*pb-c.c
> +*pb-c.h
> +*pb2.py
> +*.pyc
> diff --git a/protobuf/Makefile b/protobuf/Makefile
> index 7f6485b..a8a7666 100644
> --- a/protobuf/Makefile
> +++ b/protobuf/Makefile
> @@ -88,6 +88,8 @@ $(obj)/%.proto.c.d: $(obj)/%.proto | $(obj)/%.proto.d
>  $(obj)/%.pb-c.c $(obj)/%.pb-c.h: $(obj)/%.proto $(obj)/%.proto.c.d
>  	$(E) "  PBCC    " $@
>  	$(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $<
> +	$(E) "  PBCC    " $(@:.pb-c.c=_pb2.py)
> +	$(Q) protoc -I=$(obj)/ --python_out=$(obj)/ $<

I don't think that adding action to another target file is good idea.
You should declare separate target: deps line for .py files.

Cyrill can help.

>  ifeq ($(SRCARCH),arm)
>  	$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $@
>  	$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $(patsubst %.c,%.h,$@)
> @@ -123,3 +125,4 @@ endif
>  
>  cleanup-y += $(obj)/*.c.d $(obj)/*.pb-c.c $(obj)/*.pb-c.h
>  cleanup-y += $(obj)/*.d $(obj)/*.i $(obj)/*.s $(obj)/*.o
> +cleanup-y += $(obj)/*_pb2.py $(obj)/*.pyc
> 



More information about the CRIU mailing list