#!/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" INC="$ROOT/patch_v2/meow_launcherd" # meow_ipc.h(音量收编 v2:MSG_AUDIO_VOLUME/MSG_ACK) if [ "$1" = "host" ]; then gcc -Wall -Wextra -Os -I"$INC" -DWd_NO_MAIN -Wno-unused-function -Wno-unused-parameter \ -Wno-unused-variable test_wd_fw.c -o test_wd_fw -lm ./test_wd_fw exit $? fi echo "== meow_watchdog (mipsel static) ==" "$CC" -Os -Wall -Wextra -static -I"$INC" meow_watchdog.c -o meow_watchdog ls -la meow_watchdog md5sum meow_watchdog file meow_watchdog