aboutsummaryrefslogtreecommitdiff
path: root/scripts/Makefile.dtbinst
diff options
context:
space:
mode:
authorIngo Molnar2024-04-11 15:36:23 +0200
committerIngo Molnar2024-04-11 15:36:23 +0200
commit5b9b2e6baf9ed944a97d5a29c3386ac79937e8fc (patch)
tree542a32b1b625de2e9dc60d0944daf7cbd3357aad /scripts/Makefile.dtbinst
parent4faa0e5d6d79fc4c6e1943e8b62a65744d8439a0 (diff)
parentfec50db7033ea478773b159e0e2efb135270e3b7 (diff)
Merge tag 'v6.9-rc3' into x86/boot, to pick up fixes before queueing up more changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/Makefile.dtbinst')
-rw-r--r--scripts/Makefile.dtbinst32
1 files changed, 18 insertions, 14 deletions
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 4405d5b67578..67956f6496a5 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -8,32 +8,36 @@
# $INSTALL_PATH/dtbs/$KERNELRELEASE
# ==========================================================================
-src := $(obj)
-
PHONY := __dtbs_install
__dtbs_install:
include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
-include $(kbuild-file)
-
-dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
-subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
-__dtbs_install: $(dtbs) $(subdirs)
- @:
+dst := $(INSTALL_DTBS_PATH)
quiet_cmd_dtb_install = INSTALL $@
cmd_dtb_install = install -D $< $@
-$(dst)/%.dtb: $(obj)/%.dtb
+$(dst)/%: $(obj)/%
$(call cmd,dtb_install)
-$(dst)/%.dtbo: $(obj)/%.dtbo
- $(call cmd,dtb_install)
+dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list))
+
+ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
-PHONY += $(subdirs)
-$(subdirs):
- $(Q)$(MAKE) $(dtbinst)=$@ dst=$(if $(CONFIG_ARCH_WANT_FLAT_DTB_INSTALL),$(dst),$(patsubst $(obj)/%,$(dst)/%,$@))
+define gen_install_rules
+$(dst)/%: $(obj)/$(1)%
+ $$(call cmd,dtb_install)
+endef
+
+$(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d))))
+
+dtbs := $(notdir $(dtbs))
+
+endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
+
+__dtbs_install: $(addprefix $(dst)/, $(dtbs))
+ @:
.PHONY: $(PHONY)