diff --git a/Makefile b/Makefile index 5e58cedde5..b71b93cb43 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,7 @@ $(foreach class,$(classes), \ foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(file)))) $(eval $(foreach class,$(classes),$(call foreach-src,$(class)))) -DEPENDENCIES = $(addsuffix .d,$(basename $(allobjs))) +DEPENDENCIES += $(addsuffix .d,$(basename $(allobjs))) -include $(DEPENDENCIES) printall: diff --git a/Makefile.inc b/Makefile.inc index d82de694d4..2576ba0dc5 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -95,7 +95,8 @@ files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(dir ####################################################################### # reduce command line length by linking the objects of each # directory into an intermediate file -postprocessors += $$(foreach d,$$(sort $$(dir $$(filter %.o %.a,$$(ramstage-objs)))), \ +postprocessors += $$(eval DEPENDENCIES+=$$(addsuffix .d,$$(basename $$(ramstage-objs)))) \ + $$(foreach d,$$(sort $$(dir $$(filter %.o %.a,$$(ramstage-objs)))), \ $$(eval $$(d)ramstage.o: $$(call files-in-dir,$$(d),$$(ramstage-objs)); $$$$(call link,ramstage,$$$$(filter %.o %.a,$$$$(^)),-o $$$$(@),-r)) \ $$(eval ramstage-objs:=$$(d)ramstage.o $$(filter-out $$(call files-in-dir,$$(d),$$(filter %.o %.a,$$(ramstage-objs))),$$(ramstage-objs))))