1 # ==========================================================================
4 # Installs all dtb files listed in $(dtb-y) either in the
5 # INSTALL_DTBS_PATH directory or the default location:
7 # $INSTALL_PATH/dtbs/$KERNELRELEASE
8 # ==========================================================================
12 PHONY := __dtbs_install
15 export dtbinst_root ?= $(obj)
17 include include/config/auto.conf
18 include scripts/Kbuild.include
19 include $(src)/Makefile
21 dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
22 dtbinst-dirs := $(subdir-y) $(subdir-m)
24 # Helper targets for Installing DTBs into the boot directory
25 quiet_cmd_dtb_install = INSTALL $<
26 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
28 install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
30 $(dtbinst-files): %.dtb: $(obj)/%.dtb
31 $(call cmd,dtb_install,$(install-dir))
34 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
36 PHONY += $(dtbinst-files) $(dtbinst-dirs)
37 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs)