From 10f86b0bd8c294870dd3026d1dd55835303c416f Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 27 Mar 2015 16:56:23 +0100 Subject: build system: generalize src-to-obj It can now be used on any list of files instead of assuming to work on $($(class)-src). This is inspired by the commit listed below, but rewritten to match upstream, and split in smaller pieces to keep intent clear. Change-Id: Ib77afedd4c3f847963497beea503f5447a7c6e28 Signed-off-by: Patrick Georgi Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b Based-On-Signed-off-by: Julius Werner Based-On-Reviewed-on: https://chromium-review.googlesource.com/219170 Reviewed-on: http://review.coreboot.org/9161 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Paul Menzel --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0cc9b6a22e..c5cbda1f6d 100644 --- a/Makefile +++ b/Makefile @@ -203,8 +203,8 @@ endif # 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)))) +src-to-obj=$(addsuffix .$(1).o, $(basename $(patsubst src/%, $(obj)/%, $(2)))) +$(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class),$($(class)-srcs)))) # Save all objs before processing them (for dependency inclusion) originalobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var))) -- cgit v1.2.3