Commit 45273419 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b07d3049
...@@ -55,6 +55,7 @@ ifneq ($(lib-y),) ...@@ -55,6 +55,7 @@ ifneq ($(lib-y),)
else else
lib-target := $(obj)/lib.a lib-target := $(obj)/lib.a
endif endif
cleanup-y += $(call cleanify,$(lib-y))
cleanup-y += $(lib-target) cleanup-y += $(lib-target)
all-y += $(lib-target) all-y += $(lib-target)
endif endif
...@@ -66,6 +67,7 @@ ifneq ($(obj-y),) ...@@ -66,6 +67,7 @@ ifneq ($(obj-y),)
else else
builtin-target := $(obj)/built-in.o builtin-target := $(obj)/built-in.o
endif endif
cleanup-y += $(call cleanify,$(obj-y))
cleanup-y += $(builtin-target) cleanup-y += $(builtin-target)
all-y += $(builtin-target) all-y += $(builtin-target)
endif endif
...@@ -111,6 +113,7 @@ define gen-custom-target-rule ...@@ -111,6 +113,7 @@ define gen-custom-target-rule
$(call objectify,$($(1)-obj-y)) \ $(call objectify,$($(1)-obj-y)) \
$(call objectify,$($(1)-obj-e)))) $(call objectify,$($(1)-obj-e))))
all-y += $(obj)/$(1).built-in.o all-y += $(obj)/$(1).built-in.o
cleanup-y += $(call cleanify,$(call objectify,$($(1)-obj-y)))
cleanup-y += $(obj)/$(1).built-in.o cleanup-y += $(obj)/$(1).built-in.o
endif endif
ifneq ($($(1)-lib-y),) ifneq ($($(1)-lib-y),)
...@@ -121,6 +124,7 @@ define gen-custom-target-rule ...@@ -121,6 +124,7 @@ define gen-custom-target-rule
$(call objectify,$($(1)-lib-e)), \ $(call objectify,$($(1)-lib-e)), \
$(call objectify,$($(1)-lib-y)))) $(call objectify,$($(1)-lib-y))))
all-y += $(obj)/$(1).lib.a all-y += $(obj)/$(1).lib.a
cleanup-y += $(call cleanify,$(call objectify,$($(1)-lib-y)))
cleanup-y += $(obj)/$(1).lib.a cleanup-y += $(obj)/$(1).lib.a
endif endif
endef endef
...@@ -168,7 +172,7 @@ all: $(all-y) ...@@ -168,7 +172,7 @@ all: $(all-y)
# Clean most files, but leave enough to navigate with tags (generated files) # Clean most files, but leave enough to navigate with tags (generated files)
clean: clean:
$(call msg-clean, $(obj)) $(call msg-clean, $(obj))
$(Q) $(RM) $(obj)/*.o $(obj)/*.d $(obj)/*.i $(obj)/*.s $(cleanup-y) $(Q) $(RM) $(cleanup-y)
.PHONY: clean .PHONY: clean
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment