[git commit master 1/1] Fix out-of-tree build's recursion

Denys Vlasenko vda.linux at googlemail.com
Sun Jul 18 21:57:49 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=daf286cda559dd1eff0c9db46a4562c0255e76f1
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

While doing O=build build I've noticed that it was getting gradually
slower with each invocation. The reason turned out to be that the build
directory was inside the source tree and got recreated inside itself
with all its subdirectories.

This patch changes the behavior so that only the directories with
Kbuild.src or Config.src in them are created in the out-of-tree build
directory. A quick rebuild from scratch revealed no problems with this.

Signed-off-by: Alexander Shishkin <virtuoso at slind.org>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 scripts/gen_build_files.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 9681587..18c172d 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -53,8 +53,8 @@ fi
 
 	src="$srctree/$d/Kbuild.src"
 	dst="$d/Kbuild"
-	mkdir -p -- "$d" 2>/dev/null
 	if test -f "$src"; then
+		mkdir -p -- "$d" 2>/dev/null
 		#echo "  CHK     $dst"
 
 		s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
@@ -73,8 +73,8 @@ fi
 
 	src="$srctree/$d/Config.src"
 	dst="$d/Config.in"
-	mkdir -p -- "$d" 2>/dev/null
 	if test -f "$src"; then
+		mkdir -p -- "$d" 2>/dev/null
 		#echo "  CHK     $dst"
 
 		s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
-- 
1.7.1



More information about the busybox-cvs mailing list