summaryrefslogtreecommitdiffstats
path: root/kernel/gen_kheaders.sh
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-10-08 14:05:54 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-11-11 12:10:01 +0100
commitea79e5168be644fdaf7d4e6a73eceaf07b3da76a (patch)
treec9edc4fb6e57e71d5a9db0c59287684a687c96f6 /kernel/gen_kheaders.sh
parentkheaders: optimize md5sum calculation for in-tree builds (diff)
downloadlinux-ea79e5168be644fdaf7d4e6a73eceaf07b3da76a.tar.xz
linux-ea79e5168be644fdaf7d4e6a73eceaf07b3da76a.zip
kheaders: optimize header copy for in-tree builds
This script copies headers by the cpio command twice; first from srctree, and then from objtree. However, when we building in-tree, we know the srctree and the objtree are the same. That is, all the headers copied by the first cpio are overwritten by the second one. Skip the first cpio when we are building in-tree. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to '')
-rwxr-xr-xkernel/gen_kheaders.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh
index 6ff86e62787f..0f7752dd93a6 100755
--- a/kernel/gen_kheaders.sh
+++ b/kernel/gen_kheaders.sh
@@ -56,14 +56,16 @@ fi
rm -rf $cpio_dir
mkdir $cpio_dir
-pushd $srctree > /dev/null
-for f in $dir_list;
- do find "$f" -name "*.h";
-done | cpio --quiet -pd $cpio_dir
-popd > /dev/null
+if [ "$building_out_of_srctree" ]; then
+ pushd $srctree > /dev/null
+ for f in $dir_list
+ do find "$f" -name "*.h";
+ done | cpio --quiet -pd $cpio_dir
+ popd > /dev/null
+fi
-# The second CPIO can complain if files already exist which can
-# happen with out of tree builds. Just silence CPIO for now.
+# The second CPIO can complain if files already exist which can happen with out
+# of tree builds having stale headers in srctree. Just silence CPIO for now.
for f in $dir_list;
do find "$f" -name "*.h";
done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1