aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check-toolchain-clean.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check-toolchain-clean.sh')
-rwxr-xr-xscripts/check-toolchain-clean.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/check-toolchain-clean.sh b/scripts/check-toolchain-clean.sh
new file mode 100755
index 0000000000..af24e740b7
--- /dev/null
+++ b/scripts/check-toolchain-clean.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+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"
+make targetclean
+echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
+exit 0