diff --git a/patch_v2/meow_watchdog/build_watchdog.sh b/patch_v2/meow_watchdog/build_watchdog.sh new file mode 100755 index 0000000..3beacd5 --- /dev/null +++ b/patch_v2/meow_watchdog/build_watchdog.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# build_watchdog.sh — meow_watchdog 交叉编译(mipsel 静态)+ 宿主测试构建。 +# +# 用法: +# ./build_watchdog.sh # 交叉编译 → meow_watchdog(mipsel 静态,fw_content.conf 的 /usr/bin/meow_watchdog) +# ./build_watchdog.sh host # 宿主编译 test_wd_fw 并跑宿主回归 +set -e +cd "$(dirname "$0")" +ROOT=../../.. +CC="$ROOT/.tools/zig-mipsel-cc" + +if [ "$1" = "host" ]; then + gcc -Wall -Wextra -Os -DWd_NO_MAIN -Wno-unused-function -Wno-unused-parameter \ + test_wd_fw.c -o test_wd_fw -lm + ./test_wd_fw + exit $? +fi + +echo "== meow_watchdog (mipsel static) ==" +"$CC" -Os -Wall -Wextra -static meow_watchdog.c -o meow_watchdog +ls -la meow_watchdog +md5sum meow_watchdog +file meow_watchdog