criu/lib/py/images/Makefile
Cyrill Gorcunov b95bc0d1eb build: pycriu -- Move into lib/py
As was intended from the scratch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:32:19 +03:00

26 lines
847 B
Makefile

include $(__nmk_dir)msg.mk
all: pb.py images magic.py
.PHONY: all images clean pb.py
proto := $(filter-out $(SRC_DIR)/images/rpc.proto, $(sort $(wildcard $(SRC_DIR)/images/*.proto)))
proto-py-modules := $(foreach m,$(proto),$(subst -,_,$(notdir $(m:.proto=_pb2))))
# We don't need rpc_pb2.py here, as it is not related to the images.
# Unfortunately, we can't drop ugly _pb2 suffixes here, because
# some _pb2 files depend on others _pb2 files.
images:
$(Q) protoc -I=$(SRC_DIR)/images -I=/usr/include/ --python_out=./ $(proto)
magic.py: $(SRC_DIR)/scripts/magic-gen.py $(SRC_DIR)/criu/include/magic.h
$(call msg-gen, $@)
$(Q) python $^ $@
pb.py: images
$(Q) echo "# Autogenerated. Do not edit!" > $@
$(Q) for m in $(proto-py-modules); do \
echo "from $$m import *" >> $@ ;\
done
clean:
$(Q) $(RM) ./*_pb2.py ./*.pyc magic.py pb.py