Prevent multiple inclusions of object files and rules
authorPatrick Georgi <patrick@georgi-clan.de>
Tue, 25 Oct 2011 21:32:21 +0000 (14:32 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Fri, 28 Oct 2011 19:48:55 +0000 (21:48 +0200)
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>
Makefile

index c5438979f75799fb9cdbd274f4cc7afdaaaa29d6..f2277d16463fda937034f54779b816c3ed285d69 100644 (file)
--- 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))))