blob: 54286cccc2898336f235bf374b1881caf296b898 [file] [log] [blame]
Robert Richter9fb5e532014-09-03 15:29:24 +02001# ==========================================================================
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
11src := $(obj)
12
13PHONY := __dtbs_install
14__dtbs_install:
15
16include include/config/auto.conf
17include scripts/Kbuild.include
18include $(srctree)/$(obj)/Makefile
19
20PHONY += __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
26dtbinst-files := $(dtb-y)
27
28# Helper targets for Installing DTBs into the boot directory
29quiet_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
35PHONY += $(dtbinst-files)
36__dtbs_install: $(dtbinst-files)
37
38.PHONY: $(PHONY)