3 test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
6 cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
10 find -type d | while read -r; do
13 src="$srctree/$d/Kbuild.src"
15 if test -f "$src"; then
18 s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
19 echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
21 test x"$REPLY" = x"INSERT" && REPLY="$s"
22 printf "%s\n" "$REPLY"
23 done <"$src" >>"$dst.$$.tmp"
25 if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
29 mv -- "$dst.$$.tmp" "$dst"
33 src="$srctree/$d/Config.src"
35 if test -f "$src"; then
38 s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
39 echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
41 test x"$REPLY" = x"INSERT" && REPLY="$s"
42 printf "%s\n" "$REPLY"
43 done <"$src" >>"$dst.$$.tmp"
45 if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
49 mv -- "$dst.$$.tmp" "$dst"
55 # Last read failed. This is normal. Don't exit with its error code: