2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

nmk: build.mk -- On cleanup use cleanup-y only

With cleanify helper we remove only they files
we've been generating, not anything else.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov
2016-03-21 15:12:00 +03:00
committed by Pavel Emelyanov
parent b07d304905
commit 4527341928

View File

@@ -55,6 +55,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
@@ -66,6 +67,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
@@ -111,6 +113,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),)
@@ -121,6 +124,7 @@ define gen-custom-target-rule
$(call objectify,$($(1)-lib-e)), \
$(call objectify,$($(1)-lib-y))))
all-y += $(obj)/$(1).lib.a
cleanup-y += $(call cleanify,$(call objectify,$($(1)-lib-y)))
cleanup-y += $(obj)/$(1).lib.a
endif
endef
@@ -168,7 +172,7 @@ all: $(all-y)
# Clean most files, but leave enough to navigate with tags (generated files)
clean:
$(call msg-clean, $(obj))
$(Q) $(RM) $(obj)/*.o $(obj)/*.d $(obj)/*.i $(obj)/*.s $(cleanup-y)
$(Q) $(RM) $(cleanup-y)
.PHONY: clean
#