kbuild: Enable DT symbols when CONFIG_OF_OVERLAY is used
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/1448027270-25488-1-git-send-email-geert+renesas@glider.be
---
Replacement for "ARM: DT: Enable symbols when CONFIG_OF_OVERLAY is
used".
v3:
- Rebase on top of commit e7e2941300d258d5 ("kbuild: split device tree
build rules into scripts/Makefile.dtbs") in v6.12-rc1,
v2:
- Rebase on top of commit 8fcd8d1e63c05c48 ("kbuild: clean up code
duplication in cmd_fdtoverlay") in v6.11-rc5,
- Avoid duplicate "-@".
diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs
index 8d56c08..ca44b9e 100644
--- a/scripts/Makefile.dtbs
+++ b/scripts/Makefile.dtbs
@@ -110,8 +110,12 @@
DTC_FLAGS += $(DTC_FLAGS_$(target-stem))
+ifeq ($(CONFIG_OF_OVERLAY),y)
+DTC_FLAGS += -@
+else
# Set -@ if the target is a base DTB that overlay is applied onto
DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
+endif
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes