summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2016-01-23 00:50:00 +0100
committerNico Huber <nico.h@gmx.de>2016-01-28 00:31:00 +0100
commit81b09f40087d1a00afe30e379d2e8460203b1c5c (patch)
treef4afa32a6823caffe26009bddc6f5bfc81aa8574 /Makefile
parent116d67323b78cad4b0ddd354fc154c4e4ac60225 (diff)
downloadcoreboot-81b09f40087d1a00afe30e379d2e8460203b1c5c.tar.xz
Makefile: Make full use of src-to-obj macro
There were several spots in the tree where the path to a per class object file was hardcoded. To make use of the src-to-obj macro for this, it had to be moved before the inclusion of subdirs. Which is fine, as it doesn't have dependencies beside $(obj). Tested by verifying that the resulting coreboot.rom files didn't change for all of Jenkins' abuild configurations. Change-Id: I2eb1beeb8ae55872edfd95f750d7d5a1cee474c4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/13180 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index c46c4d8eb9..3652559595 100644
--- a/Makefile
+++ b/Makefile
@@ -180,6 +180,12 @@ add-special-class= \
$(eval $(1):=) \
$(eval special-classes+=$(1))
+# Converts one or more source file paths to their corresponding build/ paths.
+# 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)))))
+
# Clean -y variables, include Makefile.inc
# Add paths to files in X-y to X-srcs
# Add subdirs-y to subdirs
@@ -215,12 +221,6 @@ endif
# Eliminate duplicate mentions of source files in a class
$(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
-# Converts one or more source file paths to their corresponding build/ paths.
-# 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)))))
-
$(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class),$($(class)-srcs))))
# Save all objs before processing them (for dependency inclusion)