From dfaf0868b480ea8c7265ea8c407ed2502b8dcd5c Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 12 Jul 2018 15:51:38 +0300 Subject: [PATCH] nmk: Add collect-target-deps helper Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrei Vagin --- scripts/nmk/scripts/build.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk index 82b2876dc..e55fd5726 100644 --- a/scripts/nmk/scripts/build.mk +++ b/scripts/nmk/scripts/build.mk @@ -260,6 +260,12 @@ define collect-hostprogs-deps deps-y += $(addprefix $(obj)/,$($(1)-objs:.o=.d)) endif 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 ifneq ($(filter-out %.d,$(1)),) ifneq ($(filter %.o %.i %.s,$(1)),) @@ -273,11 +279,12 @@ define collect-deps deps-y += $(lib-y:.o=.d) endif $(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)),) deps-y += $(obj-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,$(target),$(eval $(call collect-target-deps,$(t),$(t)))) endif endef