blob: 8e8fdfdc92a08634d003d8c0d21e4ad1246ffb34 [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
Robert Richter9fb5e532014-09-03 15:29:24 +02008# ==========================================================================
9
10src := $(obj)
11
12PHONY := __dtbs_install
13__dtbs_install:
14
Ben Hutchings2bfbe782017-08-19 22:30:02 +010015export dtbinst_root ?= $(obj)
Robert Richter323a0282014-09-03 16:17:02 +020016
Robert Richter9fb5e532014-09-03 15:29:24 +020017include include/config/auto.conf
18include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090019include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020020
Masahiro Yamada7e7962d2017-11-05 14:30:53 +090021dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
22dtbinst-dirs := $(subdir-y) $(subdir-m)
Robert Richter9fb5e532014-09-03 15:29:24 +020023
24# Helper targets for Installing DTBs into the boot directory
25quiet_cmd_dtb_install = INSTALL $<
Robert Richter323a0282014-09-03 16:17:02 +020026 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
Robert Richter9fb5e532014-09-03 15:29:24 +020027
Ben Hutchings2bfbe782017-08-19 22:30:02 +010028install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
Robert Richter9fb5e532014-09-03 15:29:24 +020029
Robert Richter323a0282014-09-03 16:17:02 +020030$(dtbinst-files): %.dtb: $(obj)/%.dtb
31 $(call cmd,dtb_install,$(install-dir))
32
33$(dtbinst-dirs):
34 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
35
36PHONY += $(dtbinst-files) $(dtbinst-dirs)
37__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020038
39.PHONY: $(PHONY)