diff options
author | Robert Richter <rrichter@cavium.com> | 2014-09-03 10:17:02 -0400 |
---|---|---|
committer | Robert Richter <rrichter@cavium.com> | 2014-10-21 12:06:59 -0400 |
commit | 323a028d39cd8df37b1c6a62ac04987647ae4b67 (patch) | |
tree | e32837f0e55dce07e785dd70dc1730921f87509a /scripts/Makefile.dtbinst | |
parent | d38726c485d3fd6e9f2ebd1adaef0c3ead48a5ac (diff) |
dts, kbuild: Implement support for dtb vendor subdirs
This patch adds support of vendor sub directories for dtb files.
Subdirectories can be specified in $(dts-dirs). Kbuild traverses over
all directories while building and installing dtb files. The directory
tree is also reflected in the install path.
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Diffstat (limited to 'scripts/Makefile.dtbinst')
-rw-r--r-- | scripts/Makefile.dtbinst | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 54286cccc289..909ed7a2ac61 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst | |||
@@ -6,6 +6,7 @@ | |||
6 | # | 6 | # |
7 | # $INSTALL_PATH/dtbs/$KERNELRELEASE | 7 | # $INSTALL_PATH/dtbs/$KERNELRELEASE |
8 | # | 8 | # |
9 | # Traverse through subdirectories listed in $(dts-dirs). | ||
9 | # ========================================================================== | 10 | # ========================================================================== |
10 | 11 | ||
11 | src := $(obj) | 12 | src := $(obj) |
@@ -13,26 +14,38 @@ src := $(obj) | |||
13 | PHONY := __dtbs_install | 14 | PHONY := __dtbs_install |
14 | __dtbs_install: | 15 | __dtbs_install: |
15 | 16 | ||
17 | export dtbinst-root ?= $(obj) | ||
18 | |||
16 | include include/config/auto.conf | 19 | include include/config/auto.conf |
17 | include scripts/Kbuild.include | 20 | include scripts/Kbuild.include |
18 | include $(srctree)/$(obj)/Makefile | 21 | include $(srctree)/$(obj)/Makefile |
19 | 22 | ||
20 | PHONY += __dtbs_install_prep | 23 | PHONY += __dtbs_install_prep |
21 | __dtbs_install_prep: | 24 | __dtbs_install_prep: |
25 | ifeq ("$(dtbinst-root)", "$(obj)") | ||
22 | $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi | 26 | $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi |
23 | $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi | 27 | $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi |
24 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) | 28 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) |
29 | endif | ||
25 | 30 | ||
26 | dtbinst-files := $(dtb-y) | 31 | dtbinst-files := $(dtb-y) |
32 | dtbinst-dirs := $(dts-dirs) | ||
27 | 33 | ||
28 | # Helper targets for Installing DTBs into the boot directory | 34 | # Helper targets for Installing DTBs into the boot directory |
29 | quiet_cmd_dtb_install = INSTALL $< | 35 | quiet_cmd_dtb_install = INSTALL $< |
30 | cmd_dtb_install = cp $< $(2) | 36 | cmd_dtb_install = mkdir -p $(2); cp $< $(2) |
37 | |||
38 | install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) | ||
39 | |||
40 | $(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep | ||
41 | |||
42 | $(dtbinst-files): %.dtb: $(obj)/%.dtb | ||
43 | $(call cmd,dtb_install,$(install-dir)) | ||
31 | 44 | ||
32 | $(dtbinst-files): %.dtb: $(obj)/%.dtb | __dtbs_install_prep | 45 | $(dtbinst-dirs): |
33 | $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) | 46 | $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ |
34 | 47 | ||
35 | PHONY += $(dtbinst-files) | 48 | PHONY += $(dtbinst-files) $(dtbinst-dirs) |
36 | __dtbs_install: $(dtbinst-files) | 49 | __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) |
37 | 50 | ||
38 | .PHONY: $(PHONY) | 51 | .PHONY: $(PHONY) |