#!/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