Commit dfaf0868 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

nmk: Add collect-target-deps helper

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent e4f62b92
...@@ -260,6 +260,12 @@ define collect-hostprogs-deps ...@@ -260,6 +260,12 @@ define collect-hostprogs-deps
deps-y += $(addprefix $(obj)/,$($(1)-objs:.o=.d)) deps-y += $(addprefix $(obj)/,$($(1)-objs:.o=.d))
endif endif
endef endef
define collect-target-deps
ifeq ($(1),$(2))
deps-y += $(call objectify,$($(t)-lib-y:.o=.d))
deps-y += $(call objectify,$($(t)-obj-y:.o=.d))
endif
endef
define collect-deps define collect-deps
ifneq ($(filter-out %.d,$(1)),) ifneq ($(filter-out %.d,$(1)),)
ifneq ($(filter %.o %.i %.s,$(1)),) ifneq ($(filter %.o %.i %.s,$(1)),)
...@@ -273,11 +279,12 @@ define collect-deps ...@@ -273,11 +279,12 @@ define collect-deps
deps-y += $(lib-y:.o=.d) deps-y += $(lib-y:.o=.d)
endif endif
$(foreach t,$(hostprogs-y),$(eval $(call collect-hostprogs-deps,$(t),$(1)))) $(foreach t,$(hostprogs-y),$(eval $(call collect-hostprogs-deps,$(t),$(1))))
$(foreach t,$(target),$(eval $(call collect-target-deps,$(t),$(1))))
ifneq ($(filter all $(filter-out $(builtin-target) $(lib-target), $(all-y)) $(hostprogs-y),$(1)),) ifneq ($(filter all $(filter-out $(builtin-target) $(lib-target), $(all-y)) $(hostprogs-y),$(1)),)
deps-y += $(obj-y:.o=.d) deps-y += $(obj-y:.o=.d)
deps-y += $(lib-y:.o=.d) deps-y += $(lib-y:.o=.d)
deps-y += $(foreach t,$(target),$(call objectify,$($(t)-lib-y:.o=.d)) $(call objectify,$($(t)-obj-y:.o=.d)))
$(foreach t,$(hostprogs-y),$(eval $(call collect-hostprogs-deps,$(t),$(t)))) $(foreach t,$(hostprogs-y),$(eval $(call collect-hostprogs-deps,$(t),$(t))))
$(foreach t,$(target),$(eval $(call collect-target-deps,$(t),$(t))))
endif endif
endef endef
......
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