aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.dtbinst
diff options
context:
space:
mode:
authorRobert Richter <rrichter@cavium.com>2014-09-03 10:17:02 -0400
committerRobert Richter <rrichter@cavium.com>2014-10-21 12:06:59 -0400
commit323a028d39cd8df37b1c6a62ac04987647ae4b67 (patch)
treee32837f0e55dce07e785dd70dc1730921f87509a /scripts/Makefile.dtbinst
parentd38726c485d3fd6e9f2ebd1adaef0c3ead48a5ac (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.dtbinst23
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
11src := $(obj) 12src := $(obj)
@@ -13,26 +14,38 @@ src := $(obj)
13PHONY := __dtbs_install 14PHONY := __dtbs_install
14__dtbs_install: 15__dtbs_install:
15 16
17export dtbinst-root ?= $(obj)
18
16include include/config/auto.conf 19include include/config/auto.conf
17include scripts/Kbuild.include 20include scripts/Kbuild.include
18include $(srctree)/$(obj)/Makefile 21include $(srctree)/$(obj)/Makefile
19 22
20PHONY += __dtbs_install_prep 23PHONY += __dtbs_install_prep
21__dtbs_install_prep: 24__dtbs_install_prep:
25ifeq ("$(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)
29endif
25 30
26dtbinst-files := $(dtb-y) 31dtbinst-files := $(dtb-y)
32dtbinst-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
29quiet_cmd_dtb_install = INSTALL $< 35quiet_cmd_dtb_install = INSTALL $<
30 cmd_dtb_install = cp $< $(2) 36 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
37
38install-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
35PHONY += $(dtbinst-files) 48PHONY += $(dtbinst-files) $(dtbinst-dirs)
36__dtbs_install: $(dtbinst-files) 49__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
37 50
38.PHONY: $(PHONY) 51.PHONY: $(PHONY)