From 98fc426a98db7e4dd5fea334edec720721d2a89c Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 23 Jan 2016 01:24:33 +0100 Subject: Move object files to $(obj)// Instead of tagging object files with ., move them to a directory below $(obj)/. This way we can keep a 1:1 mapping between source- and object-file names. The 1:1 mapping is a prerequisite for Ada, where the compiler refuses any other object-file name. Tested by verifying that the resulting coreboot.rom files didn't change for all of Jenkins' abuild configurations. Change-Id: Idb7a8abec4ea0a37021d9fc24cc8583c4d3bf67c Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/13181 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3652559595..a464345810 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,13 @@ add-special-class= \ # Only .c and .S get converted to .o, other files (like .ld) keep their name. # $1 stage name # $2 file path (list) -src-to-obj=$(foreach file,$(2),$(subst .$(1),,$(basename $(patsubst src/%,$(obj)/%,$(file)))).$(1)$(patsubst %.c,%.o,$(patsubst %.S,%.o,$(suffix $(file))))) +src-to-obj=\ + $(patsubst $(obj)/%,$(obj)/$(1)/%,\ + $(patsubst $(obj)/$(1)/%,$(obj)/%,\ + $(patsubst src/%,$(obj)/%,\ + $(patsubst %.c,%.o,\ + $(patsubst %.S,%.o,\ + $(subst .$(1),,$(2))))))) # Clean -y variables, include Makefile.inc # Add paths to files in X-y to X-srcs -- cgit v1.2.3