summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2011-10-25 14:32:21 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-28 21:48:55 +0200
commit94a458626a9f12aa670926d633f445bebc1fb63c (patch)
tree32d70406bfcaf5e891b5856c9354bbaf9736d716 /Makefile
parentea5c2b62caec8a2acd5298777b825b799e2b9c15 (diff)
Prevent multiple inclusions of object files and rules
This removes 54 make warnings from the build Change-Id: I94ac9875526febe2f95334c1c3971641c1d27f8f Signed-off-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/338 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c5438979f7..f2277d1646 100644
--- a/Makefile
+++ b/Makefile
@@ -204,6 +204,9 @@ evaluate_subdirs= \
subdirs:=$(TOPLEVEL)
$(eval $(call evaluate_subdirs))
+# Eliminate duplicate mentions of source files in a class
+$(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
+
src-to-obj=$(addsuffix .$(1).o, $(basename $(patsubst src/%, $(obj)/%, $($(1)-srcs))))
$(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class))))