Commit 9ca15086 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

nmk: Make collect-deps to be more precise about targets

Thus to choose which deps to include, for example if only
particular file is being build there is no need to include
any other deps.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 44b67053
...@@ -277,20 +277,22 @@ define collect-target-deps ...@@ -277,20 +277,22 @@ define collect-target-deps
endif endif
endef endef
define collect-deps define collect-deps
ifneq ($(filter-out %.d,$(1)),) ifneq ($(filter all,$(1)),)
ifneq ($(filter %.o %.i %.s,$(1)),) $(eval $(call collect-builtin-deps,$(builtin-target),$(builtin-target)))
deps-y += $(addsuffix .d,$(basename $(1))) $(eval $(call collect-lib-deps,$(lib-target),$(lib-target)))
endif
endif
$(eval $(call collect-builtin-deps,$(builtin-target),$(1)))
$(eval $(call collect-lib-deps,$(lib-target),$(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)),)
deps-y += $(obj-y:.o=.d)
deps-y += $(lib-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)))) $(foreach t,$(target),$(eval $(call collect-target-deps,$(t),$(t))))
else
ifneq ($(filter-out %.d $(builtin-target) $(lib-target) $(hostprogs-y) $(target),$(1)),)
ifneq ($(filter %.o %.i %.s,$(1)),)
deps-y += $(addsuffix .d,$(basename $(1)))
endif
else
$(eval $(call collect-builtin-deps,$(builtin-target),$(1)))
$(eval $(call collect-lib-deps,$(lib-target),$(1)))
$(foreach t,$(hostprogs-y),$(eval $(call collect-hostprogs-deps,$(t),$(1))))
$(foreach t,$(target),$(eval $(call collect-target-deps,$(t),$(1))))
endif
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