Files

31 lines
1.7 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_sdk.sh — 构建 meow_ui.a(mipsel 静态库,内含 meow_font.o,应用只需链 meow_ui.a + libz.a + -lpthread)。
#
# 本公开 SDK 仓**自包含**:公共头(meow_ui.h 伞头 + include/ 子头 + meow_ipc.h / meow_font.h /
# meow_notif.h)与字体运行时源码(meow_font.c)都在 sdk/ 内,不再依赖主仓 meow_launcherd/。
#
# 交叉编译器:默认 MeowOS 开发机路径 $HOME/Project/R3ProII/.tools/zig-mipsel-cc;
# 可用环境变量 MEOW_CC 覆盖(或用你自己装好的 zig 交叉 cc,--target=mipsel-linux-musleabi soft-float)。
set -e
cd "$(dirname "$0")"
CC="${MEOW_CC:-$HOME/Project/R3ProII/.tools/zig-mipsel-cc}"
AR="${AR:-/usr/bin/ar}" # 系统 GNU ar 即可归档 mipsel ELF 对象(架构无关)
rm -f meow_ui.a *.o
# meow_font.c = 预渲染位图字体运行时(自包含:只含 meow_font.h + 标准头;最小 zlib ABI 自声明,
# 链接时用 sysroot 的 libz.a),随 SDK 一并 vendored。新模块(box/anim/scroll/str + cachegov/lazygrid/
# select/net_ipc)随主仓增量并入。
OBJS="meow_ui_gfx meow_ui_log meow_ui_notify meow_notify_ipc meow_ui_img meow_ui_widget meow_ui_input meow_ui_theme meow_ui_ime meow_pinyin meow_ui_sys meow_ui_vol meow_ui_activity meow_ui_global meow_ui_dialog meow_ui_config meow_ui_draw meow_ui_view meow_ui_nav meow_ui_media meow_ui_audio stb_image meow_font meow_ui_box meow_ui_anim meow_ui_scroll meow_ui_str meow_cachegov meow_lazygrid meow_select meow_net_ipc"
CFLAGS="-Os -static -Iinclude -I."
for f in $OBJS; do
echo "== cc $f =="
"$CC" $CFLAGS -c "$f.c" -o "$f.o"
done
rm -f meow_ui.a
for f in $OBJS; do "$AR" rcs meow_ui.a "$f.o"; done
echo "== meow_ui.a =="
ls -la meow_ui.a
"$AR" t meow_ui.a