summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_build_files.sh80
1 files changed, 40 insertions, 40 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 3d75750..2baefa2 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -3,52 +3,52 @@
test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# cd to objtree
-cd "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
+cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
srctree="$1"
find -type d | while read; do
- d="$REPLY"
-
- src="$srctree/$d/Kbuild.src"
- dst="$d/Kbuild"
- if test -f "$src"; then
- echo " CHK $dst"
-
- s=`sed -n 's@^//kbuild:@@p' "$srctree/$d"/*.c`
- echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
- while read; do
- test x"$REPLY" = x"INSERT" && REPLY="$s"
- printf "%s\n" "$REPLY"
- done <"$src" >>"$dst.$$.tmp"
-
- if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
- rm "$dst.$$.tmp"
- else
- echo " GEN $dst"
- mv "$dst.$$.tmp" "$dst"
+ d="$REPLY"
+
+ src="$srctree/$d/Kbuild.src"
+ dst="$d/Kbuild"
+ if test -f "$src"; then
+ echo " CHK $dst"
+
+ s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
+ echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
+ while read; do
+ test x"$REPLY" = x"INSERT" && REPLY="$s"
+ printf "%s\n" "$REPLY"
+ done <"$src" >>"$dst.$$.tmp"
+
+ if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
+ rm -- "$dst.$$.tmp"
+ else
+ echo " GEN $dst"
+ mv -- "$dst.$$.tmp" "$dst"
+ fi
fi
- fi
-
- src="$srctree/$d/Config.src"
- dst="$d/Config.in"
- if test -f "$src"; then
- echo " CHK $dst"
-
- s=`sed -n 's@^//config:@@p' "$srctree/$d"/*.c`
- echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
- while read; do
- test x"$REPLY" = x"INSERT" && REPLY="$s"
- printf "%s\n" "$REPLY"
- done <"$src" >>"$dst.$$.tmp"
-
- if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
- rm "$dst.$$.tmp"
- else
- echo " GEN $dst"
- mv "$dst.$$.tmp" "$dst"
+
+ src="$srctree/$d/Config.src"
+ dst="$d/Config.in"
+ if test -f "$src"; then
+ echo " CHK $dst"
+
+ s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
+ echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
+ while read; do
+ test x"$REPLY" = x"INSERT" && REPLY="$s"
+ printf "%s\n" "$REPLY"
+ done <"$src" >>"$dst.$$.tmp"
+
+ if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
+ rm -- "$dst.$$.tmp"
+ else
+ echo " GEN $dst"
+ mv -- "$dst.$$.tmp" "$dst"
+ fi
fi
- fi
done