feat(build):添加UPX压缩支持以减小可执行文件体积

📝 docs:更新README文档,添加Makefile使用说明和UPX压缩说明
🔧 chore:添加Makefile简化构建流程,支持自动UPX压缩
🔧 chore:添加cabal.project.local配置文件优化构建
⬆️ chore:升级项目版本至0.3.0.2
🔧 chore:优化GHC编译选项,启用优化和链接器优化
This commit is contained in:
2026-02-04 17:54:09 +08:00
parent 83d6d79bc4
commit e4b3cebf2b
6 changed files with 115 additions and 3 deletions

View File

@@ -29,6 +29,42 @@ cabal build
cabal install
```
### 使用 Makefile
项目提供了 Makefile 来简化构建和压缩过程:
```bash
git clone https://git.lyz.one/sidneyzhang/quickjump.git
cd quickjump
# 构建并压缩(推荐)
make
# 或者分步执行
make build # 仅构建
make compress # 压缩可执行文件
make install # 安装
```
### 关于 UPX 压缩
Makefile 的 `compress` 目标会使用 UPXUltimate Packer for eXecutables来压缩可执行文件显著减小文件体积
- 如果系统已安装 UPX直接使用本地 UPX 进行压缩
- 如果系统未安装 UPX会自动使用 `npx` 下载并运行最新版本的 UPX
UPX 压缩参数:
- `--best`:使用最佳压缩级别
- `--lzma`:使用 LZMA 算法(压缩率更高)
**注意**:使用 `npx` 运行 UPX 需要 Node.js 和 npm 环境。如果不想使用 UPX 压缩,可以直接运行 `make build``cabal build`
查看所有可用的 Makefile 目标:
```bash
make help
```
## 配置 Shell 集成
### Linux/macOS (Bash/Zsh)