blob: a1be75d0a5fd3fbf4742e555046896ea6fa6fe65 [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#
Robert Richter323a0282014-09-03 16:17:02 +02009# Traverse through subdirectories listed in $(dts-dirs).
Robert Richter9fb5e532014-09-03 15:29:24 +020010# ==========================================================================
11
12src := $(obj)
13
14PHONY := __dtbs_install
15__dtbs_install:
16
Robert Richter323a0282014-09-03 16:17:02 +020017export dtbinst-root ?= $(obj)
18
Robert Richter9fb5e532014-09-03 15:29:24 +020019include include/config/auto.conf
20include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090021include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020022
23PHONY += __dtbs_install_prep
24__dtbs_install_prep:
Robert Richter323a0282014-09-03 16:17:02 +020025ifeq ("$(dtbinst-root)", "$(obj)")
Robert Richter9fb5e532014-09-03 15:29:24 +020026 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
Robert Richter323a0282014-09-03 16:17:02 +020027endif
Robert Richter9fb5e532014-09-03 15:29:24 +020028
29dtbinst-files := $(dtb-y)
Robert Richter323a0282014-09-03 16:17:02 +020030dtbinst-dirs := $(dts-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020031
32# Helper targets for Installing DTBs into the boot directory
33quiet_cmd_dtb_install = INSTALL $<
Robert Richter323a0282014-09-03 16:17:02 +020034 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
Robert Richter9fb5e532014-09-03 15:29:24 +020035
Robert Richter323a0282014-09-03 16:17:02 +020036install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
Robert Richter9fb5e532014-09-03 15:29:24 +020037
Robert Richter323a0282014-09-03 16:17:02 +020038$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
39
40$(dtbinst-files): %.dtb: $(obj)/%.dtb
41 $(call cmd,dtb_install,$(install-dir))
42
43$(dtbinst-dirs):
44 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
45
46PHONY += $(dtbinst-files) $(dtbinst-dirs)
47__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020048
49.PHONY: $(PHONY)