blob: 993fb85982df2df2a7f8e20780d0cfbe3cb732e8 [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
8#
Robert Richter323a0282014-09-03 16:17:02 +02009# Traverse through subdirectories listed in $(dts-dirs).
Robert Richter9fb5e532014-09-03 15:29:24 +020010# ==========================================================================
11
12src := $(obj)
13
14PHONY := __dtbs_install
15__dtbs_install:
16
Ben Hutchings2bfbe782017-08-19 22:30:02 +010017export dtbinst_root ?= $(obj)
Robert Richter323a0282014-09-03 16:17:02 +020018
Robert Richter9fb5e532014-09-03 15:29:24 +020019include include/config/auto.conf
20include scripts/Kbuild.include
Masahiro Yamada5f655c72015-03-27 20:43:37 +090021include $(src)/Makefile
Robert Richter9fb5e532014-09-03 15:29:24 +020022
Robert Richter9fb5e532014-09-03 15:29:24 +020023dtbinst-files := $(dtb-y)
Robert Richter323a0282014-09-03 16:17:02 +020024dtbinst-dirs := $(dts-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020025
26# Helper targets for Installing DTBs into the boot directory
27quiet_cmd_dtb_install = INSTALL $<
Robert Richter323a0282014-09-03 16:17:02 +020028 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
Robert Richter9fb5e532014-09-03 15:29:24 +020029
Ben Hutchings2bfbe782017-08-19 22:30:02 +010030install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
Robert Richter9fb5e532014-09-03 15:29:24 +020031
Robert Richter323a0282014-09-03 16:17:02 +020032$(dtbinst-files): %.dtb: $(obj)/%.dtb
33 $(call cmd,dtb_install,$(install-dir))
34
35$(dtbinst-dirs):
36 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
37
38PHONY += $(dtbinst-files) $(dtbinst-dirs)
39__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
Robert Richter9fb5e532014-09-03 15:29:24 +020040
41.PHONY: $(PHONY)