mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-19 01:26:22 +00:00
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>
26 lines
847 B
Makefile
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
|