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
9 # Traverse through subdirectories listed in $(dts-dirs).
10 # ==========================================================================
14 PHONY := __dtbs_install
17 export dtbinst_root ?= $(obj)
19 include include/config/auto.conf
20 include scripts/Kbuild.include
21 include $(src)/Makefile
23 dtbinst-files := $(dtb-y)
24 dtbinst-dirs := $(dts-dirs)
26 # Helper targets for Installing DTBs into the boot directory
27 quiet_cmd_dtb_install = INSTALL $<
28 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
30 install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
32 $(dtbinst-files): %.dtb: $(obj)/%.dtb
33 $(call cmd,dtb_install,$(install-dir))
36 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
38 PHONY += $(dtbinst-files) $(dtbinst-dirs)
39 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs)