mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 01:59:04 +00:00
As all builds are done from top source dir, there is no need to have SRC_DIR. Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
25 lines
882 B
Makefile
25 lines
882 B
Makefile
all-y += images magic.py pb.py
|
|
|
|
proto := $(filter-out images/rpc.proto, $(sort $(wildcard 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=images/ -I=/usr/include/ --python_out=$(obj) $(proto)
|
|
.PHONY: images
|
|
|
|
magic.py: scripts/magic-gen.py criu/include/magic.h
|
|
$(call msg-gen, $@)
|
|
$(Q) python $^ $(obj)/$@
|
|
|
|
pb.py: images
|
|
$(Q) echo "# Autogenerated. Do not edit!" > $(obj)/$@
|
|
$(Q) for m in $(proto-py-modules); do \
|
|
echo "from $$m import *" >> $(obj)/$@ ;\
|
|
done
|
|
.PHONY: pb.py
|
|
|
|
cleanup-y += $(addprefix $(obj)/,magic.py pb.py *.pyc)
|
|
cleanup-y += $(call cleanify,$(addprefix $(obj)/,$(addsuffix .py,$(proto-py-modules))))
|