]>
Commit | Line | Data |
---|---|---|
9fb5e537 RR |
1 | # ========================================================================== |
2 | # Installing dtb files | |
3 | # | |
4 | # Installs all dtb files listed in $(dtb-y) either in the | |
5 | # INSTALL_DTBS_PATH directory or the default location: | |
6 | # | |
7 | # $INSTALL_PATH/dtbs/$KERNELRELEASE | |
8 | # | |
323a028d | 9 | # Traverse through subdirectories listed in $(dts-dirs). |
9fb5e537 RR |
10 | # ========================================================================== |
11 | ||
12 | src := $(obj) | |
13 | ||
14 | PHONY := __dtbs_install | |
15 | __dtbs_install: | |
16 | ||
323a028d RR |
17 | export dtbinst-root ?= $(obj) |
18 | ||
9fb5e537 RR |
19 | include include/config/auto.conf |
20 | include scripts/Kbuild.include | |
5f655c7a | 21 | include $(src)/Makefile |
9fb5e537 RR |
22 | |
23 | PHONY += __dtbs_install_prep | |
24 | __dtbs_install_prep: | |
323a028d | 25 | ifeq ("$(dtbinst-root)", "$(obj)") |
9fb5e537 | 26 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) |
323a028d | 27 | endif |
9fb5e537 RR |
28 | |
29 | dtbinst-files := $(dtb-y) | |
323a028d | 30 | dtbinst-dirs := $(dts-dirs) |
9fb5e537 RR |
31 | |
32 | # Helper targets for Installing DTBs into the boot directory | |
33 | quiet_cmd_dtb_install = INSTALL $< | |
323a028d RR |
34 | cmd_dtb_install = mkdir -p $(2); cp $< $(2) |
35 | ||
36 | install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) | |
37 | ||
38 | $(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep | |
39 | ||
40 | $(dtbinst-files): %.dtb: $(obj)/%.dtb | |
41 | $(call cmd,dtb_install,$(install-dir)) | |
9fb5e537 | 42 | |
323a028d RR |
43 | $(dtbinst-dirs): |
44 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ | |
9fb5e537 | 45 | |
323a028d RR |
46 | PHONY += $(dtbinst-files) $(dtbinst-dirs) |
47 | __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) | |
9fb5e537 RR |
48 | |
49 | .PHONY: $(PHONY) |