Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
9fb5e537 RR |
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 | |
9fb5e537 RR |
9 | # ========================================================================== |
10 | ||
11 | src := $(obj) | |
12 | ||
13 | PHONY := __dtbs_install | |
14 | __dtbs_install: | |
15 | ||
2bfbe788 | 16 | export dtbinst_root ?= $(obj) |
323a028d | 17 | |
9fb5e537 RR |
18 | include include/config/auto.conf |
19 | include scripts/Kbuild.include | |
5f655c7a | 20 | include $(src)/Makefile |
9fb5e537 | 21 | |
7e7962dd MY |
22 | dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-))) |
23 | dtbinst-dirs := $(subdir-y) $(subdir-m) | |
9fb5e537 RR |
24 | |
25 | # Helper targets for Installing DTBs into the boot directory | |
26 | quiet_cmd_dtb_install = INSTALL $< | |
323a028d RR |
27 | cmd_dtb_install = mkdir -p $(2); cp $< $(2) |
28 | ||
2bfbe788 | 29 | install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) |
323a028d | 30 | |
323a028d RR |
31 | $(dtbinst-files): %.dtb: $(obj)/%.dtb |
32 | $(call cmd,dtb_install,$(install-dir)) | |
9fb5e537 | 33 | |
323a028d RR |
34 | $(dtbinst-dirs): |
35 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ | |
9fb5e537 | 36 | |
323a028d RR |
37 | PHONY += $(dtbinst-files) $(dtbinst-dirs) |
38 | __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) | |
9fb5e537 RR |
39 | |
40 | .PHONY: $(PHONY) |