aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check-toolchain-clean.sh
blob: 455cfb0449f3a0bfff285c3e8f3bc5b779ca22e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
eval "$(grep CONFIG_GCC_VERSION .config)"
CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)"
touch .toolchain_build_ver
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