blob: 50d580d77ae920b9c96d52639ec3b229082707db [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================
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# ==========================================================================
10
11src := $(obj)
12
13PHONY := __dtbs_install
14__dtbs_install:
15
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016include include/config/auto.conf
17include scripts/Kbuild.include
18include $(src)/Makefile
19
Olivier Deprez157378f2022-04-04 15:47:50 +020020dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
21subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022
Olivier Deprez157378f2022-04-04 15:47:50 +020023__dtbs_install: $(dtbs) $(subdirs)
24 @:
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025
Olivier Deprez157378f2022-04-04 15:47:50 +020026quiet_cmd_dtb_install = INSTALL $@
27 cmd_dtb_install = install -D $< $@
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000028
Olivier Deprez157378f2022-04-04 15:47:50 +020029$(dst)/%.dtb: $(obj)/%.dtb
30 $(call cmd,dtb_install)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000031
Olivier Deprez157378f2022-04-04 15:47:50 +020032PHONY += $(subdirs)
33$(subdirs):
34 $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000035
36.PHONY: $(PHONY)