[CRIU] [PATCH 9/9] nmk: build.mk -- On cleanup use cleanup-y only

Dmitry Safonov dsafonov at virtuozzo.com
Mon Mar 21 05:42:29 PDT 2016


On 03/21/2016 03:12 PM, Cyrill Gorcunov wrote:
> From: Cyrill Gorcunov <gorcunov at gmail.com>
>
> With cleanify helper we remove only they files
> we've been generating, not anything else.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> ---
>   scripts/nmk/scripts/build.mk | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
> index 440cfa167a7e..4e69f657ce3a 100644
> --- a/scripts/nmk/scripts/build.mk
> +++ b/scripts/nmk/scripts/build.mk
> @@ -65,6 +65,7 @@ ifneq ($(lib-y),)
>           else
>                   lib-target := $(obj)/lib.a
>           endif
> +        cleanup-y += $(call cleanify,$(lib-y))
>           cleanup-y += $(lib-target)
>           all-y += $(lib-target)
>   endif
> @@ -76,6 +77,7 @@ ifneq ($(obj-y),)
>           else
>                   builtin-target := $(obj)/built-in.o
>           endif
> +        cleanup-y += $(call cleanify,$(obj-y))
>           cleanup-y += $(builtin-target)
>           all-y += $(builtin-target)
>   endif
> @@ -124,6 +126,7 @@ define gen-custom-target-rule
>                                   $(call objectify,$($(1)-obj-y))         \
>                                   $(call objectify,$($(1)-obj-e))))
>                   all-y += $(obj)/$(1).built-in.o
> +                cleanup-y += $(call cleanify,$(call objectify,$($(1)-obj-y)))
>                   cleanup-y += $(obj)/$(1).built-in.o
>           endif
>           ifneq ($($(1)-lib-y),)
> @@ -135,6 +138,7 @@ define gen-custom-target-rule
>                                   $(call objectify,$($(1)-lib-y)))        \
>                                   $(call objectify,$($(1)-lib-e)))
>                   all-y += $(obj)/$(1).lib.a
> +                cleanup-y += $(call cleanify,$(call objectify,$($(1)-lib-y)))
>                   cleanup-y += $(obj)/$(1).lib.a
>           endif
>   endef
> @@ -182,7 +186,7 @@ all: $(all-y)
>   # Clean everything up.
>   clean:
>   	$(call msg-clean, $(obj))
> -	$(Q) $(RM) $(obj)/*.o $(obj)/*.d $(obj)/*.i $(obj)/*.s $(cleanup-y)
> +	$(Q) $(RM) $(cleanup-y)
>   .PHONY: clean
>   
>   #


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list