Back to home page

LXR

 
 

    


0001 # ==========================================================================
0002 # Installing dtb files
0003 #
0004 # Installs all dtb files listed in $(dtb-y) either in the
0005 # INSTALL_DTBS_PATH directory or the default location:
0006 #
0007 #   $INSTALL_PATH/dtbs/$KERNELRELEASE
0008 #
0009 # Traverse through subdirectories listed in $(dts-dirs).
0010 # ==========================================================================
0011 
0012 src := $(obj)
0013 
0014 PHONY := __dtbs_install
0015 __dtbs_install:
0016 
0017 export dtbinst-root ?= $(obj)
0018 
0019 include include/config/auto.conf
0020 include scripts/Kbuild.include
0021 include $(src)/Makefile
0022 
0023 PHONY += __dtbs_install_prep
0024 __dtbs_install_prep:
0025 ifeq ("$(dtbinst-root)", "$(obj)")
0026         $(Q)mkdir -p $(INSTALL_DTBS_PATH)
0027 endif
0028 
0029 dtbinst-files   := $(dtb-y)
0030 dtbinst-dirs    := $(dts-dirs)
0031 
0032 # Helper targets for Installing DTBs into the boot directory
0033 quiet_cmd_dtb_install = INSTALL $<
0034       cmd_dtb_install = mkdir -p $(2); cp $< $(2)
0035 
0036 install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
0037 
0038 $(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
0039 
0040 $(dtbinst-files): %.dtb: $(obj)/%.dtb
0041         $(call cmd,dtb_install,$(install-dir))
0042 
0043 $(dtbinst-dirs):
0044         $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
0045 
0046 PHONY += $(dtbinst-files) $(dtbinst-dirs)
0047 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
0048 
0049 .PHONY: $(PHONY)