@@ -263,7 +263,14 @@ srctree := $(abs_srctree)
263263endif
264264265265objtree := .
266+267+VPATH :=
268+269+ifeq ($(KBUILD_EXTMOD),)
270+ifdef building_out_of_srctree
266271VPATH := $(srctree)
272+endif
273+endif
267274268275export building_out_of_srctree srctree objtree VPATH
269276@@ -942,7 +949,6 @@ endif
942949ifdef CONFIG_LTO_CLANG
943950ifdef CONFIG_LTO_CLANG_THIN
944951CC_FLAGS_LTO := -flto=thin -fsplit-lto-unit
945-KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod_prefix).thinlto-cache
946952else
947953CC_FLAGS_LTO := -flto
948954endif
@@ -1248,8 +1254,8 @@ define filechk_version.h
12481254 echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
12491255endef
125012561251-$(version_h): PATCHLEVEL := $(or $(PATCHLEVEL), 0)
1252-$(version_h): SUBLEVEL := $(or $(SUBLEVEL), 0)
1257+$(version_h): private PATCHLEVEL := $(or $(PATCHLEVEL), 0)
1258+$(version_h): private SUBLEVEL := $(or $(SUBLEVEL), 0)
12531259$(version_h): FORCE
12541260$(call filechk,version.h)
12551261@@ -1403,7 +1409,7 @@ export CHECK_DTBS=y
14031409endif
1404141014051411ifneq ($(CHECK_DTBS),)
1406-dtbs_prepare: dt_binding_check
1412+dtbs_prepare: dt_binding_schemas
14071413endif
1408141414091415dtbs_check: dtbs
@@ -1422,15 +1428,18 @@ scripts_dtc: scripts_basic
14221428$(Q)$(MAKE) $(build)=scripts/dtc
1423142914241430ifneq ($(filter dt_binding_check, $(MAKECMDGOALS)),)
1425-export CHECK_DT_BINDING=y
1431+export CHECK_DTBS=y
14261432endif
142714331428-PHONY += dt_binding_check
1429-dt_binding_check: scripts_dtc
1434+PHONY += dt_binding_check dt_binding_schemas
1435+dt_binding_check: dt_binding_schemas scripts_dtc
1436+$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@
1437+1438+dt_binding_schemas:
14301439$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
1431144014321441PHONY += dt_compatible_check
1433-dt_compatible_check: dt_binding_check
1442+dt_compatible_check: dt_binding_schemas
14341443$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@
1435144414361445# ---------------------------------------------------------------------------
@@ -1477,7 +1486,7 @@ endif # CONFIG_MODULES
14771486# Directories & files removed with 'make clean'
14781487CLEAN_FILES += vmlinux.symvers modules-only.symvers \
14791488 modules.builtin modules.builtin.modinfo modules.nsdeps \
1480- compile_commands.json .thinlto-cache rust/test \
1489+ compile_commands.json rust/test \
14811490 rust-project.json .vmlinux.objs .vmlinux.export.c
1482149114831492# Directories & files removed with 'make mrproper'
@@ -1494,7 +1503,7 @@ MRPROPER_FILES += include/config include/generated \
1494150314951504# clean - Delete most, but leave enough to build external modules
14961505#
1497-clean: rm-files := $(CLEAN_FILES)
1506+clean: private rm-files := $(CLEAN_FILES)
1498150714991508PHONY += archclean vmlinuxclean
15001509@@ -1506,7 +1515,7 @@ clean: archclean vmlinuxclean resolve_btfids_clean
1506151515071516# mrproper - Delete all generated files, including .config
15081517#
1509-mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
1518+mrproper: private rm-files := $(MRPROPER_FILES)
15101519mrproper-dirs := $(addprefix _mrproper_,scripts)
1511152015121521PHONY += $(mrproper-dirs) mrproper
@@ -1626,10 +1635,11 @@ help:
16261635 @echo ''
16271636 @$(if $(dtstree), \
16281637echo 'Devicetree:'; \
1629-echo '* dtbs - Build device tree blobs for enabled boards'; \
1630-echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
1631-echo ' dt_binding_check - Validate device tree binding documents'; \
1632-echo ' dtbs_check - Validate device tree source files';\
1638+echo '* dtbs - Build device tree blobs for enabled boards'; \
1639+echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
1640+echo ' dt_binding_check - Validate device tree binding documents and examples'; \
1641+echo ' dt_binding_schema - Build processed device tree binding schemas'; \
1642+echo ' dtbs_check - Validate device tree source files';\
16331643echo '')
1634164416351645 @echo 'Userspace tools targets:'
@@ -1782,8 +1792,8 @@ compile_commands.json: $(extmod_prefix)compile_commands.json
17821792PHONY += compile_commands.json
1783179317841794clean-dirs := $(KBUILD_EXTMOD)
1785-clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
1786-$(KBUILD_EXTMOD)/compile_commands.json $(KBUILD_EXTMOD)/.thinlto-cache
1795+clean: private rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
1796+$(KBUILD_EXTMOD)/compile_commands.json
1787179717881798PHONY += prepare
17891799# now expand this into a simple variable to reduce the cost of shell evaluations