summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-05-19 16:13:46 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-05-20 13:16:57 +0200
commite4e36abf1cf104f5853ee828332ad28f2c9f801b (patch)
treed3fdcf39cadcdb8c4efa20577f0b4a6da1270f7b /scripts
parentff047395b9746aee1fe24e9c3f122c3706e72781 (diff)
downloadbarebox-e4e36abf1cf104f5853ee828332ad28f2c9f801b.tar.gz
barebox-e4e36abf1cf104f5853ee828332ad28f2c9f801b.tar.xz
kbuild: remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntax
The embedded DTBs are compiled by the chain of pattern rules as follows: %.dts -> %.dtb -> %.dtb.S -> %.dtb.o for barebox proper %.dts -> %.dtb -> %.dtb.S -> %.dtb.pbl.o for pbl Barebox introduced {obj,pbl,lwl}-dtb-y syntax to put the intermediate files into extra-y. The purposes of doing so were: [1] prevent GNU Make from deleting the intermediate files [2] include .*.cmd files In contrast, Linux does not use a special syntax for embedding DTBs into the kernel. For example, as you see in arch/sh/boot/dts/Makefile of Linux 5.6, obj-y += <basename>.dtb.o ... just works. This is because scripts/Kbuild.include specifies .SECONDARY to cater to [1], and scripts/Makefile.build adds the intermediates to 'targets' to deal with [2]. Barebox had already imported the same code from Linux, so you can use obj-y instead of obj-dtb-y, like Linux. pbl-dtb-y and lwl-dtb-y are barebox-specific cases, so I added the %.dtb.pbl.o pattern to intermediate_targets. Going forward, please use obj-y, pbl-y, or lwl-y. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.lib14
2 files changed, 4 insertions, 12 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 956df9e23a..f4e7719801 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -304,10 +304,12 @@ intermediate_targets = $(foreach sfx, $(2), \
$(filter %$(strip $(1)), $(targets))))
# %.asn1.o <- %.asn1.[ch] <- %.asn1
# %.dtb.o <- %.dtb.S <- %.dtb <- %.dts
+# %.dtb.pbl.o <- %.dtb.S <- %.dtb <- %.dts (Barebox only)
# %.lex.o <- %.lex.c <- %.l
# %.tab.o <- %.tab.[ch] <- %.y
targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
$(call intermediate_targets, .dtb.o, .dtb.S .dtb) \
+ $(call intermediate_targets, .dtb.pbl.o, .dtb.S .dtb) \
$(call intermediate_targets, .lex.o, .lex.c) \
$(call intermediate_targets, .tab.o, .tab.c .tab.h)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 273113ff5a..604bedfc5d 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -20,16 +20,6 @@ obj-m := $(filter-out $(obj-y),$(obj-m))
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
-
-pbl-y += $(pbl-dtb-y)
-obj-y += $(obj-dtb-y)
-extra-y += $(patsubst %.dtb.o,%.dtb.S,$(obj-dtb-y))
-extra-y += $(patsubst %.dtb.o,%.dtb,$(obj-dtb-y))
-extra-y += $(patsubst %.dtb.o,%.dtb.S,$(pbl-dtb-y))
-extra-y += $(patsubst %.dtb.o,%.dtb,$(pbl-dtb-y))
-extra-y += $(patsubst %.dtb.o,%.dtb.S,$(lwl-dtb-y))
-extra-y += $(patsubst %.dtb.o,%.dtb,$(lwl-dtb-y))
-
# Handle objects in subdirs
# ---------------------------------------------------------------------------
# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
@@ -40,9 +30,9 @@ extra-y += $(patsubst %.dtb.o,%.dtb,$(lwl-dtb-y))
# lowlevel is present in the PBL if enabled
# otherwise in barebox
ifeq ($(CONFIG_PBL_IMAGE), y)
-pbl-y += $(lwl-y) $(lwl-dtb-y)
+pbl-y += $(lwl-y)
else
-obj-y += $(lwl-y) $(lwl-dtb-y)
+obj-y += $(lwl-y)
endif
obj-y += $(obj-pbl-y)