Files

41 lines
1.4 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# build_amsd.sh — meow_amsd 交叉编译(mipsel 静态)+ 宿主多目标可选。
#
# 目标:R3 Pro II / MeowOS(mipsel-linux-muslsf,静态)。amsd/am 极简仅 POSIX + Linux 基础接口
# + 复用 launcher 的 meow_ipc.h(-I../meow_launcherd),单文件即可固件内/usr/bin。
#
# 用法:
# ./build_amsd.sh # 交叉编译 → meow_amsd(mipsel 静态)
# ./build_amsd.sh am # 交叉编译 am CLI → am(mipsel 静态)
# ./build_amsd.sh host # 宿主编译 meow_amsd_host + am_host + ams_stub_host(集成测试)
set -e
cd "$(dirname "$0")"
ROOT="$HOME/Project/R3ProII"
CC="$ROOT/.tools/zig-mipsel-cc"
if [ "$1" = "host" ]; then
HOST_CC="${CC_HOST:-cc}"
"$HOST_CC" -I"$ROOT/patch_v2/meow_launcherd" -Os -Wall -Wextra meow_amsd.c -o meow_amsd_host
"$HOST_CC" -Os -Wall -Wextra am.c -o am_host
"$HOST_CC" -Os -Wall -Wextra ams_stub.c -o ams_stub_host
echo "== host builds =="
ls -la meow_amsd_host am_host ams_stub_host
file meow_amsd_host am_host ams_stub_host
exit 0
fi
if [ "$1" = "am" ]; then
"$CC" -Os -Wall -Wextra -static am.c -o am
echo "== am (mipsel static) =="
ls -la am
md5sum am
file am
exit 0
fi
"$CC" -I"$ROOT/patch_v2/meow_launcherd" -Os -Wall -Wextra -static meow_amsd.c -o meow_amsd
echo "== meow_amsd (mipsel static) =="
ls -la meow_amsd
md5sum meow_amsd
file meow_amsd