[CRIU] [PATCH] build: criu -- Drop redundant phonies

Tycho Andersen tycho.andersen at canonical.com
Wed Feb 24 08:55:39 PST 2016


On Wed, Feb 24, 2016 at 07:51:47PM +0300, Cyrill Gorcunov wrote:
> On Wed, Feb 24, 2016 at 07:15:07PM +0300, Cyrill Gorcunov wrote:
> > Everytime we build the executable we've to check
> > all the deps and sources for changes, thus
> > don't protvide criu/criu on toplevel as
> > a target file (my bug in 496b51b64a6).
> 
> Tycho give the attached patch a shot please.

> From e47737d4c5b3c3d99e67f06ed0d6f88f0f9195b5 Mon Sep 17 00:00:00 2001
> From: Cyrill Gorcunov <gorcunov at openvz.org>
> Date: Wed, 24 Feb 2016 19:10:38 +0300
> Subject: [PATCH] build: criu -- Drop redundant phonies
> 
> Everytime we build the executable we've to check
> all the deps and sources for changes, thus
> don't protvide criu/criu on toplevel as
> a target file (my bug in 496b51b64a6).
> 
> Instead bring this target as a phony back
> but drop phony from criu/Makefile itself,
> as it should be from the beginning.
> 
> Same time remove unneeded phonies over
> the targets which are real files.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>

Tested-by: Tycho Andersen <tycho.andersen at canonical.com>

Thanks Cyrill!

Tycho

> ---
>  Makefile      | 11 ++++++-----
>  criu/Makefile | 12 +++++-------
>  2 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 290624917aea..defa7e3667c4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -116,20 +116,21 @@ PHONY += images
>  # the nmk so we can reuse it there.
>  criu/%: images/built-in.o
>  	$(Q) $(MAKE) -C criu $@
> -criu/criu: images/built-in.o
> -	$(Q) $(MAKE) -C criu criu
> +criu: images/built-in.o
> +	$(Q) $(MAKE) -C criu all
> +.PHONY: criu
>  
>  #
>  # Libraries next once criu it ready
>  # (we might generate headers and such
>  # when building criu itself).
> -lib/%: criu/criu
> +lib/%: criu
>  	$(Q) $(MAKE) -C lib $@
> -lib: criu/criu
> +lib: criu
>  	$(Q) $(MAKE) -C lib all
>  PHONY += lib
>  
> -all: criu/criu lib
> +all: criu lib
>  PHONY += all
>  
>  clean-built:
> diff --git a/criu/Makefile b/criu/Makefile
> index 1e1c73ce22d3..ea79183f0d3a 100644
> --- a/criu/Makefile
> +++ b/criu/Makefile
> @@ -102,14 +102,12 @@ config: $(VERSION_HEADER)
>  SYSCALL-LIB		:= $(ARCH_DIR)/syscalls.built-in.o
>  $(SYSCALL-LIB): config
>  	$(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all
> -PHONY += $(SYSCALL-LIB)
>  
>  #
>  # Architecture dependant part.
>  ARCH-LIB		:= $(ARCH_DIR)/crtools.built-in.o
>  $(ARCH-LIB): config $(SYSCALL-LIB)
>  	$(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) $@
> -PHONY += $(ARCH-LIB)
>  
>  #
>  # piegen tool needed for PIE code.
> @@ -132,7 +130,7 @@ pie/lib.a: $(ARCH-LIB) $(SYSCALL-LIB)
>  # PIE code blobs themseves.
>  pie: $(piegen-bin) pie/lib.a
>  	$(Q) $(MAKE) $(build)=pie all
> -PHONY += pie
> +.PHONY: pie
>  
>  #
>  # CRIU executable
> @@ -149,7 +147,6 @@ built-in.o: pie
>  criu: $(PROGRAM-BUILTINS)
>  	$(call msg-link, $@)
>  	$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
> -PHONY += criu
>  
>  #
>  # Cleanup everything.
> @@ -166,6 +163,7 @@ clean:
>  	$(Q) $(RM) $(VERSION_HEADER)
>  	$(Q) $(RM) $(CONFIG_HEADER)
>  	$(Q) $(RM) criu
> +.PHONY: clean
>  
>  UAPI_HEADERS := include/criu-plugin.h include/criu-log.h
>  
> @@ -175,10 +173,10 @@ install: criu
>  	$(Q) install -m 755 criu $(DESTDIR)$(SBINDIR)
>  	$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
>  	$(Q) install -m 644 $(UAPI_HEADERS) $(DESTDIR)$(INCLUDEDIR)
> +.PHONY: install
>  
>  #
>  # Final @all target.
> -all: $(PHONY)
> +all: criu
>  	@true
> -
> -.PHONY: $(PHONY) clean install
> +.PHONY: all
> -- 
> 2.5.0
> 



More information about the CRIU mailing list