rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 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 | # |
| 10 | # Traverse through subdirectories listed in $(dts-dirs). |
| 11 | # ========================================================================== |
| 12 | |
| 13 | src := $(obj) |
| 14 | |
| 15 | PHONY := __dtbs_install |
| 16 | __dtbs_install: |
| 17 | |
| 18 | export dtbinst_root ?= $(obj) |
| 19 | |
| 20 | include include/config/auto.conf |
| 21 | include scripts/Kbuild.include |
| 22 | include $(src)/Makefile |
| 23 | |
| 24 | dtbinst-files := $(dtb-y) |
| 25 | dtbinst-dirs := $(dts-dirs) |
| 26 | |
| 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) |
| 30 | |
| 31 | install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) |
| 32 | |
| 33 | $(dtbinst-files): %.dtb: $(obj)/%.dtb |
| 34 | $(call cmd,dtb_install,$(install-dir)) |
| 35 | |
| 36 | $(dtbinst-dirs): |
| 37 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ |
| 38 | |
| 39 | PHONY += $(dtbinst-files) $(dtbinst-dirs) |
| 40 | __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) |
| 41 | |
| 42 | .PHONY: $(PHONY) |