aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/check-toolchain-clean.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/check-toolchain-clean.sh b/scripts/check-toolchain-clean.sh
index 34b82dec5d..455cfb0449 100755
--- a/scripts/check-toolchain-clean.sh
+++ b/scripts/check-toolchain-clean.sh
@@ -2,8 +2,13 @@
eval "$(grep CONFIG_GCC_VERSION .config)"
CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)"
touch .toolchain_build_ver
-[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$(cat .toolchain_build_ver)" ] && exit 0
-echo "Toolchain build version changed, running make targetclean"
+CURRENT_TOOLCHAIN_BUILD_VER="$(cat .toolchain_build_ver)"
+[ -z "$CURRENT_TOOLCHAIN_BUILD_VER" ] && {
+ echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
+ exit 0
+}
+[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$CURRENT_TOOLCHAIN_BUILD_VER" ] && exit 0
+echo "Toolchain build version changed ($CONFIG_TOOLCHAIN_BUILD_VER != $CURRENT_TOOLCHAIN_BUILD_VER), running make targetclean"
make targetclean
echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
exit 0