Linux 4.14.89
[linux-stable.git] / scripts / Makefile.dtbinst
blobc8ba6e7f9868e8d048f3595f2ed7ed5a7674c8be
1 # SPDX-License-Identifier: GPL-2.0
2 # ==========================================================================
3 # Installing dtb files
5 # Installs all dtb files listed in $(dtb-y) either in the
6 # INSTALL_DTBS_PATH directory or the default location:
8 #   $INSTALL_PATH/dtbs/$KERNELRELEASE
10 # Traverse through subdirectories listed in $(dts-dirs).
11 # ==========================================================================
13 src := $(obj)
15 PHONY := __dtbs_install
16 __dtbs_install:
18 export dtbinst_root ?= $(obj)
20 include include/config/auto.conf
21 include scripts/Kbuild.include
22 include $(src)/Makefile
24 dtbinst-files   := $(dtb-y)
25 dtbinst-dirs    := $(dts-dirs)
27 # Helper targets for Installing DTBs into the boot directory
28 quiet_cmd_dtb_install = INSTALL $<
29       cmd_dtb_install = mkdir -p $(2); cp $< $(2)
31 install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
33 $(dtbinst-files): %.dtb: $(obj)/%.dtb
34         $(call cmd,dtb_install,$(install-dir))
36 $(dtbinst-dirs):
37         $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
39 PHONY += $(dtbinst-files) $(dtbinst-dirs)
40 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
42 .PHONY: $(PHONY)