fix make O=dir build
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f343818..5685b5b 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -13,8 +13,13 @@
include scripts/Kbuild.include
# The filename Kbuild has precedence over Makefile
+# bbox: we also try to include Kbuild file in obj tree first
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, \
+ $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, \
+ $(kbuild-dir)/Makefile \
+ ) \
+ )
include scripts/Makefile.lib