criu/lib/py/Makefile
Kir Kolyshkin ab90777ca1 Makefiles: protect from % rules, don't rebuild
GNU make tries to rebuild any makefiles it uses. While in general it's
a good idea (and it is used e.g. in autoconf-based builds), in our case
it is not necessary, as all the makefiles are static.

More to say, as we have a few "match anything" rules for subdirectories,
Makefiles in these subdirs are also matching these rules, which leads to
excessive (re)building while a particular makefile is needed.

Protect such Makefiles with explicit (or pattern) rules, so make knows
it should do nothing to rebuild those.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00

21 lines
452 B
Makefile

all-y += libpy-images rpc_pb2.py
.PHONY: .FORCE
$(obj)/images/Makefile: ;
$(obj)/images/%: .FORCE
$(Q) $(MAKE) $(build)=$(obj)/images $@
libpy-images:
$(Q) $(MAKE) $(build)=$(obj)/images all
.PHONY: libpy-images
rpc_pb2.py:
$(Q) protoc -I=images/ --python_out=$(obj) images/$(@:_pb2.py=.proto)
cleanup-y += $(addprefix $(obj)/,rpc_pb2.py *.pyc)
clean-lib-py:
$(Q) $(MAKE) $(build)=$(obj)/images clean
.PHONY: clean-lib-py
clean: clean-lib-py