blob: 7301ab5e2e066b458fcadfe47bc2574af769155d [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
Robert Richter9fb5e532014-09-03 15:29:24 +02009# ==========================================================================
10
11src := $(obj)
12
13PHONY := __dtbs_install
14__dtbs_install:
15
Ben Hutchings2bfbe782017-08-19 22:30:02 +010016export dtbinst_root ?= $(obj)
Robert Richter323a0282014-09-03 16:17:02 +020017
Robert Richter9fb5e532014-09-03 15:29:24 +020018include include/config/auto.conf
19include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090020include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020021
Masahiro Yamada7e7962d2017-11-05 14:30:53 +090022dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
23dtbinst-dirs := $(subdir-y) $(subdir-m)
Robert Richter9fb5e532014-09-03 15:29:24 +020024
25# Helper targets for Installing DTBs into the boot directory
26quiet_cmd_dtb_install = INSTALL $<
Robert Richter323a0282014-09-03 16:17:02 +020027 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
Robert Richter9fb5e532014-09-03 15:29:24 +020028
Ben Hutchings2bfbe782017-08-19 22:30:02 +010029install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
Robert Richter9fb5e532014-09-03 15:29:24 +020030
Robert Richter323a0282014-09-03 16:17:02 +020031$(dtbinst-files): %.dtb: $(obj)/%.dtb
32 $(call cmd,dtb_install,$(install-dir))
33
34$(dtbinst-dirs):
35 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
36
37PHONY += $(dtbinst-files) $(dtbinst-dirs)
38__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020039
40.PHONY: $(PHONY)