blob: c8ba6e7f9868e8d048f3595f2ed7ed5a7674c8be [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Robert Richter9fb5e532014-09-03 15:29:24 +02002# ==========================================================================
3# Installing dtb files
4#
5# Installs all dtb files listed in $(dtb-y) either in the
6# INSTALL_DTBS_PATH directory or the default location:
7#
8# $INSTALL_PATH/dtbs/$KERNELRELEASE
9#
Robert Richter323a0282014-09-03 16:17:02 +020010# Traverse through subdirectories listed in $(dts-dirs).
Robert Richter9fb5e532014-09-03 15:29:24 +020011# ==========================================================================
12
13src := $(obj)
14
15PHONY := __dtbs_install
16__dtbs_install:
17
Ben Hutchings2bfbe782017-08-19 22:30:02 +010018export dtbinst_root ?= $(obj)
Robert Richter323a0282014-09-03 16:17:02 +020019
Robert Richter9fb5e532014-09-03 15:29:24 +020020include include/config/auto.conf
21include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090022include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020023
Robert Richter9fb5e532014-09-03 15:29:24 +020024dtbinst-files := $(dtb-y)
Robert Richter323a0282014-09-03 16:17:02 +020025dtbinst-dirs := $(dts-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020026
27# Helper targets for Installing DTBs into the boot directory
28quiet_cmd_dtb_install = INSTALL $<
Robert Richter323a0282014-09-03 16:17:02 +020029 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
Robert Richter9fb5e532014-09-03 15:29:24 +020030
Ben Hutchings2bfbe782017-08-19 22:30:02 +010031install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
Robert Richter9fb5e532014-09-03 15:29:24 +020032
Robert Richter323a0282014-09-03 16:17:02 +020033$(dtbinst-files): %.dtb: $(obj)/%.dtb
34 $(call cmd,dtb_install,$(install-dir))
35
36$(dtbinst-dirs):
37 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
38
39PHONY += $(dtbinst-files) $(dtbinst-dirs)
40__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020041
42.PHONY: $(PHONY)