Retrieve the list of *.dtb(o) files from arch/*/boot/dts/dtbs-list instead of traversing the directory tree again. Please note that 'make dtbs_install' installs *.dtb(o) files directly added to dtb-y because scripts/Makefile.dtbinst installs $(dtb-y) without expanding the -dtbs suffix. This commit preserves this behavior.
Showing the changes to scripts (2 of 3 files). Show all
Unified · Split
| @@ -113,12 +113,6 @@ endef · 112 unmodified lines | |||
| 113 | # $(Q)$(MAKE) $(build)=dir | 113 | # $(Q)$(MAKE) $(build)=dir |
| 114 | build := -f $(srctree)/scripts/Makefile.build obj | 114 | build := -f $(srctree)/scripts/Makefile.build obj |
| 115 | 115 | ||
| 116 | ### | ||
| 117 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj= | ||
| 118 | # Usage: | ||
| 119 | # $(Q)$(MAKE) $(dtbinst)=dir | ||
| 120 | dtbinst := -f $(srctree)/scripts/Makefile.dtbinst obj | ||
| 121 | |||
| 122 | ### | 116 | ### |
| 123 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj= | 117 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj= |
| 124 | # Usage: | 118 | # Usage: |
| @@ -8,32 +8,36 @@ · 7 unmodified lines | |||
| 8 | # $INSTALL_PATH/dtbs/$KERNELRELEASE | 8 | # $INSTALL_PATH/dtbs/$KERNELRELEASE |
| 9 | # ========================================================================== | 9 | # ========================================================================== |
| 10 | 10 | ||
| 11 | src := $(obj) | ||
| 12 | |||
| 13 | PHONY := __dtbs_install | 11 | PHONY := __dtbs_install |
| 14 | __dtbs_install: | 12 | __dtbs_install: |
| 15 | 13 | ||
| 16 | include include/config/auto.conf | 14 | include include/config/auto.conf |
| 17 | include $(srctree)/scripts/Kbuild.include | 15 | include $(srctree)/scripts/Kbuild.include |
| 18 | include $(kbuild-file) | ||
| 19 | |||
| 20 | dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) | ||
| 21 | subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) | ||
| 22 | 16 | ||
| 23 | __dtbs_install: $(dtbs) $(subdirs) | 17 | dst := $(INSTALL_DTBS_PATH) |
| 24 | @: | ||
| 25 | 18 | ||
| 26 | quiet_cmd_dtb_install = INSTALL $@ | 19 | quiet_cmd_dtb_install = INSTALL $@ |
| 27 | cmd_dtb_install = install -D $< $@ | 20 | cmd_dtb_install = install -D $< $@ |
| 28 | 21 | ||
| 29 | $(dst)/%.dtb: $(obj)/%.dtb | 22 | $(dst)/%: $(obj)/% |
| 30 | $(call cmd,dtb_install) | 23 | $(call cmd,dtb_install) |
| 31 | 24 | ||
| 32 | $(dst)/%.dtbo: $(obj)/%.dtbo | 25 | dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list)) |
| 33 | $(call cmd,dtb_install) | 26 | |
| 27 | ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL | ||
| 34 | 28 | ||
| 35 | PHONY += $(subdirs) | 29 | define gen_install_rules |
| 36 | $(subdirs): | 30 | $(dst)/%: $(obj)/$(1)% |
| 37 | $(Q)$(MAKE) $(dtbinst)=$@ dst=$(if $(CONFIG_ARCH_WANT_FLAT_DTB_INSTALL),$(dst),$(patsubst $(obj)/%,$(dst)/%,$@)) | 31 | $$(call cmd,dtb_install) |
| 32 | endef | ||
| 33 | |||
| 34 | $(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d)))) | ||
| 35 | |||
| 36 | dtbs := $(notdir $(dtbs)) | ||
| 37 | |||
| 38 | endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL | ||
| 39 | |||
| 40 | __dtbs_install: $(addprefix $(dst)/, $(dtbs)) | ||
| 41 | @: | ||
| 38 | 42 | ||
| 39 | .PHONY: $(PHONY) | 43 | .PHONY: $(PHONY) |