Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame^] | 1 | # ========================================================================== |
| 2 | # Installing dtb files |
| 3 | # |
| 4 | # Installs all dtb files listed in $(dtb-y) either in the |
| 5 | # INSTALL_DTBS_PATH directory or the default location: |
| 6 | # |
| 7 | # $INSTALL_PATH/dtbs/$KERNELRELEASE |
| 8 | # |
| 9 | # ========================================================================== |
| 10 | |
| 11 | src := $(obj) |
| 12 | |
| 13 | PHONY := __dtbs_install |
| 14 | __dtbs_install: |
| 15 | |
| 16 | include include/config/auto.conf |
| 17 | include scripts/Kbuild.include |
| 18 | include $(srctree)/$(obj)/Makefile |
| 19 | |
| 20 | PHONY += __dtbs_install_prep |
| 21 | __dtbs_install_prep: |
| 22 | $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi |
| 23 | $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi |
| 24 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) |
| 25 | |
| 26 | dtbinst-files := $(dtb-y) |
| 27 | |
| 28 | # Helper targets for Installing DTBs into the boot directory |
| 29 | quiet_cmd_dtb_install = INSTALL $< |
| 30 | cmd_dtb_install = cp $< $(2) |
| 31 | |
| 32 | $(dtbinst-files): %.dtb: $(obj)/%.dtb | __dtbs_install_prep |
| 33 | $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) |
| 34 | |
| 35 | PHONY += $(dtbinst-files) |
| 36 | __dtbs_install: $(dtbinst-files) |
| 37 | |
| 38 | .PHONY: $(PHONY) |