blob: 455cfb0449f3a0bfff285c3e8f3bc5b779ca22e1 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2eval "$(grep CONFIG_GCC_VERSION .config)"
3CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)"
4touch .toolchain_build_ver
5CURRENT_TOOLCHAIN_BUILD_VER="$(cat .toolchain_build_ver)"
6[ -z "$CURRENT_TOOLCHAIN_BUILD_VER" ] && {
7 echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
8 exit 0
9}
10[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$CURRENT_TOOLCHAIN_BUILD_VER" ] && exit 0
11echo "Toolchain build version changed ($CONFIG_TOOLCHAIN_BUILD_VER != $CURRENT_TOOLCHAIN_BUILD_VER), running make targetclean"
12make targetclean
13echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
14exit 0