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