b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | eval "$(grep CONFIG_GCC_VERSION .config)" |
| 3 | CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)" |
| 4 | touch .toolchain_build_ver |
| 5 | CURRENT_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 |
| 11 | echo "Toolchain build version changed ($CONFIG_TOOLCHAIN_BUILD_VER != $CURRENT_TOOLCHAIN_BUILD_VER), running make targetclean" |
| 12 | make targetclean |
| 13 | echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver |
| 14 | exit 0 |