From 65a930d9236100b1152fdfe6e4623301ccde82a1 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Wed, 5 Aug 2020 13:17:00 +0000 Subject: [PATCH] Makefiles: do not re-generate magic.py every time I always wondered why re-running make on a criu checkout always prints out GEN magic.py even if no file has changed. It seems the Makefile was looking for the file in the wrong location. Providing the full path to the file will now only rebuild magic.py if something actually changed that requires a rebuild. Signed-off-by: Adrian Reber --- lib/py/images/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/py/images/Makefile b/lib/py/images/Makefile index f7df20f12..d55362dd1 100644 --- a/lib/py/images/Makefile +++ b/lib/py/images/Makefile @@ -1,4 +1,4 @@ -all-y += images magic.py pb.py +all-y += images $(obj)/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)))) @@ -10,9 +10,9 @@ images: $(Q) protoc -I=images/ -I=/usr/include/ --python_out=$(obj) $(proto) .PHONY: images -magic.py: scripts/magic-gen.py criu/include/magic.h +$(obj)/magic.py: scripts/magic-gen.py criu/include/magic.h $(call msg-gen, $@) - $(Q) $(PYTHON) $^ $(obj)/$@ + $(Q) $(PYTHON) $^ $@ pb.py: images $(Q) echo "# Autogenerated. Do not edit!" > $(obj)/$@