[CRIU] Re: [PATCH]

Kinsbursky Stanislav skinsbursky at openvz.org
Thu Apr 5 09:09:35 EDT 2012


05.04.2012 17:02, Cyrill Gorcunov пишет:
> Guys, while being mocking with root Makefile I found that
> filtering of goals is not going fine, ie "make clean" called
> twice in a row forced make to generate deps, which is useless
> of course.
>
> So the fix is below, please review. The idea is to generate
> deps IIF they are really needed, which are the cases
>
>   - one of *.o,*.s,*.i file is about to build
>   - one of general targets such as crtools,zdtm,test-legacy
>     acquired
>
> anything else (including clean,docs and such) should not
> generate deps, saving cpu cycles ;)

I'm really confused.
Git commit d1df3f60 did exactly the same. But this code part was rewritten 
several times already (I missed these patches).
Or I'm missing something?

> 	Cyrill
> ---
> From: Cyrill Gorcunov<gorcunov at openvz.org>
> Date: Thu, 5 Apr 2012 16:49:12 +0400
> Subject: [PATCH] make: Fix dependency generation
>
> In case if no goals specified the all
> goal is implied so don't forget to generate
> deps. This as well fixes a problem where
> two "make clean" in a row forced build system
> to regenerate deps.
>
> Signed-off-by: Cyrill Gorcunov<gorcunov at openvz.org>
> ---
>   Makefile |   12 ++++++++++--
>   1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 40e3249..cc490c8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -200,8 +200,16 @@ help:
>   	$(E) '      test            - Run zdtm test-suite'
>   .PHONY: help
>
> -deps-targets := %.o %.s %.i
> +deps-targets := %.o %.s %.i $(PROGRAM) zdtm test-legacy
>
> -ifeq ($(filter deps-targets, $(MAKECMDGOALS)),)
> +ifneq ($(filter $(deps-targets), $(MAKECMDGOALS)),)
> +	INCDEPS := 1
> +endif
> +
> +ifeq ($(MAKECMDGOALS),)
> +	INCDEPS := 1
> +endif
> +
> +ifeq ($(INCDEPS),1)
>   -include $(DEPS)
>   endif


-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list