summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-07-24 12:59:19 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-30 20:19:40 +0300
commitee47620367d5b5ee6a1934888bf1ae46576be757 (patch)
tree41503c9d7a257cbef6c002b579f7e49cd52a2bc9 /Makefile
parent7dea20f2fecbde5df321d6d9d0b7765be6edc28c (diff)
downloadlinux-ee47620367d5b5ee6a1934888bf1ae46576be757.tar.xz
kbuild: add dtbs_prepare target
Factor out the common prerequisites for DT compilation into the new target, dtbs_prepare. Add comments to explain why include/config/kernel.release is the prerequisite. Our policy is that installation targets must not rebuild anything in the tree. If 'make modules_install' is executed as root, include/config/kernel.release may be owned by root. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index dee707c98bbe..a2a030f41e65 100644
--- a/Makefile
+++ b/Makefile
@@ -1370,16 +1370,21 @@ endif
ifneq ($(dtstree),)
-%.dtb: include/config/kernel.release scripts_dtc
+%.dtb: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
-%.dtbo: include/config/kernel.release scripts_dtc
+%.dtbo: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
-PHONY += dtbs dtbs_install dtbs_check
-dtbs: include/config/kernel.release scripts_dtc
+PHONY += dtbs dtbs_prepare dtbs_install dtbs_check
+dtbs: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree)
+# include/config/kernel.release is actually needed when installing DTBs because
+# INSTALL_DTBS_PATH contains $(KERNELRELEASE). However, we do not want to make
+# dtbs_install depend on it as dtbs_install may run as root.
+dtbs_prepare: include/config/kernel.release scripts_dtc
+
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
export CHECK_DTBS=y
dtbs: dt_binding_check