blob: ba01f5ba25172192e7c000a62d59a37857218e8d [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
16include include/config/auto.conf
17include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090018include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020019
Masahiro Yamadaaefd8032020-03-07 02:08:52 +090020dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
21subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
Robert Richter9fb5e532014-09-03 15:29:24 +020022
Masahiro Yamadaaefd8032020-03-07 02:08:52 +090023__dtbs_install: $(dtbs) $(subdirs)
24 @:
Robert Richter9fb5e532014-09-03 15:29:24 +020025
Masahiro Yamadaaefd8032020-03-07 02:08:52 +090026quiet_cmd_dtb_install = INSTALL $@
27 cmd_dtb_install = install -D $< $@
Robert Richter323a0282014-09-03 16:17:02 +020028
Masahiro Yamadaaefd8032020-03-07 02:08:52 +090029$(dst)/%.dtb: $(obj)/%.dtb
30 $(call cmd,dtb_install)
Robert Richter323a0282014-09-03 16:17:02 +020031
Viresh Kumarce88c9c2021-01-29 12:54:08 +053032$(dst)/%.dtbo: $(obj)/%.dtbo
33 $(call cmd,dtb_install)
34
Masahiro Yamadaaefd8032020-03-07 02:08:52 +090035PHONY += $(subdirs)
36$(subdirs):
37 $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
Robert Richter9fb5e532014-09-03 15:29:24 +020038
39.PHONY: $(PHONY)