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) |
6790be24 | 25 | dtboinst-files := $(dtbo-y) |
323a028d | 26 | dtbinst-dirs := $(dts-dirs) |
9fb5e537 RR |
27 | |
28 | # Helper targets for Installing DTBs into the boot directory | |
29 | quiet_cmd_dtb_install = INSTALL $< | |
323a028d RR |
30 | cmd_dtb_install = mkdir -p $(2); cp $< $(2) |
31 | ||
2bfbe788 | 32 | install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) |
323a028d | 33 | |
6790be24 YN |
34 | $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs): | __dtbs_install_prep |
35 | ||
323a028d RR |
36 | $(dtbinst-files): %.dtb: $(obj)/%.dtb |
37 | $(call cmd,dtb_install,$(install-dir)) | |
9fb5e537 | 38 | |
6790be24 YN |
39 | $(dtboinst-files): %.dtbo: $(obj)/%.dtbo |
40 | $(call cmd,dtb_install,$(install-dir)) | |
41 | ||
323a028d RR |
42 | $(dtbinst-dirs): |
43 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ | |
9fb5e537 | 44 | |
6790be24 YN |
45 | PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs) |
46 | __dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs) | |
9fb5e537 RR |
47 | |
48 | .PHONY: $(PHONY) |