Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 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 |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 9 | # ========================================================================== |
| 10 | |
| 11 | src := $(obj) |
| 12 | |
| 13 | PHONY := __dtbs_install |
| 14 | __dtbs_install: |
| 15 | |
Ben Hutchings | 2bfbe78 | 2017-08-19 22:30:02 +0100 | [diff] [blame] | 16 | export dtbinst_root ?= $(obj) |
Robert Richter | 323a028 | 2014-09-03 16:17:02 +0200 | [diff] [blame] | 17 | |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 18 | include include/config/auto.conf |
| 19 | include scripts/Kbuild.include |
Masahiro Yamada | 5f655c7 | 2015-03-27 20:43:37 +0900 | [diff] [blame] | 20 | include $(src)/Makefile |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 21 | |
Masahiro Yamada | 7e7962d | 2017-11-05 14:30:53 +0900 | [diff] [blame] | 22 | dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-))) |
| 23 | dtbinst-dirs := $(subdir-y) $(subdir-m) |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 24 | |
| 25 | # Helper targets for Installing DTBs into the boot directory |
| 26 | quiet_cmd_dtb_install = INSTALL $< |
Robert Richter | 323a028 | 2014-09-03 16:17:02 +0200 | [diff] [blame] | 27 | cmd_dtb_install = mkdir -p $(2); cp $< $(2) |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 28 | |
Ben Hutchings | 2bfbe78 | 2017-08-19 22:30:02 +0100 | [diff] [blame] | 29 | install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 30 | |
Robert Richter | 323a028 | 2014-09-03 16:17:02 +0200 | [diff] [blame] | 31 | $(dtbinst-files): %.dtb: $(obj)/%.dtb |
| 32 | $(call cmd,dtb_install,$(install-dir)) |
| 33 | |
| 34 | $(dtbinst-dirs): |
| 35 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ |
| 36 | |
| 37 | PHONY += $(dtbinst-files) $(dtbinst-dirs) |
| 38 | __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) |
Robert Richter | 9fb5e53 | 2014-09-03 15:29:24 +0200 | [diff] [blame] | 39 | |
| 40 | .PHONY: $(PHONY) |