kbuild: compute the dtbs_install destination more simply
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 6 Mar 2020 17:08:51 +0000 (02:08 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 25 Mar 2020 01:19:43 +0000 (10:19 +0900)
The 'dtbinst_root' is used to remember the root of the in-kernel dts
directory (i.e. arch/*/boot/dts), but it looks clumsy.

I prefer using two variables 'obj' and 'dst' to track the in-kernel
directory and the install destination, respectively.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
scripts/Makefile.dtbinst

index 8533bb68d69b235f98f8dbf63b4fb02a5ed370e4..d32e8c86f09c1d7c73ad85dbd707480bd7405738 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1258,7 +1258,7 @@ endif
 dtbs_check: dtbs
 
 dtbs_install:
-       $(Q)$(MAKE) $(dtbinst)=$(dtstree)
+       $(Q)$(MAKE) $(dtbinst)=$(dtstree) dst=$(INSTALL_DTBS_PATH)
 
 ifdef CONFIG_OF_EARLY_FLATTREE
 all: dtbs
index 7301ab5e2e066b458fcadfe47bc2574af769155d..fcd5f2eaaad1367bd78ee6aaf47ecba146e12d04 100644 (file)
@@ -13,8 +13,6 @@ src := $(obj)
 PHONY := __dtbs_install
 __dtbs_install:
 
-export dtbinst_root ?= $(obj)
-
 include include/config/auto.conf
 include scripts/Kbuild.include
 include $(src)/Makefile
@@ -26,13 +24,11 @@ dtbinst-dirs        := $(subdir-y) $(subdir-m)
 quiet_cmd_dtb_install =        INSTALL $<
       cmd_dtb_install =        mkdir -p $(2); cp $< $(2)
 
-install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
-
 $(dtbinst-files): %.dtb: $(obj)/%.dtb
-       $(call cmd,dtb_install,$(install-dir))
+       $(call cmd,dtb_install,$(dst))
 
 $(dtbinst-dirs):
-       $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
+       $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ dst=$(dst)/$@
 
 PHONY += $(dtbinst-files) $(dtbinst-dirs)
 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs)