Commit 44b67053 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

nmk: Add obj and lib deps gathering via helpers

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent dfaf0868
...@@ -255,6 +255,16 @@ $(foreach t,$(libso-y),$(eval $(call gen-so-link-rules,$(t)))) ...@@ -255,6 +255,16 @@ $(foreach t,$(libso-y),$(eval $(call gen-so-link-rules,$(t))))
# #
# Figure out if the target we're building needs deps to include. # Figure out if the target we're building needs deps to include.
define collect-builtin-deps
ifeq ($(1),$(2))
deps-y += $(obj-y:.o=.d)
endif
endef
define collect-lib-deps
ifeq ($(1),$(2))
deps-y += $(lib-y:.o=.d)
endif
endef
define collect-hostprogs-deps define collect-hostprogs-deps
ifeq ($(1),$(2)) ifeq ($(1),$(2))
deps-y += $(addprefix $(obj)/,$($(1)-objs:.o=.d)) deps-y += $(addprefix $(obj)/,$($(1)-objs:.o=.d))
...@@ -272,12 +282,8 @@ define collect-deps ...@@ -272,12 +282,8 @@ define collect-deps
deps-y += $(addsuffix .d,$(basename $(1))) deps-y += $(addsuffix .d,$(basename $(1)))
endif endif
endif endif
ifeq ($(builtin-target),$(1)) $(eval $(call collect-builtin-deps,$(builtin-target),$(1)))
deps-y += $(obj-y:.o=.d) $(eval $(call collect-lib-deps,$(lib-target),$(1)))
endif
ifeq ($(lib-target),$(1))
deps-y += $(lib-y:.o=.d)
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)))) $(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)),)
......
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