From 8b763f7af4f597ba9930044c7a56f1e938ffdfd7 Mon Sep 17 00:00:00 2001 From: captain Date: Sun, 5 Apr 2026 18:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 36 ++++++++++++++++++++++++++++++++++++ README.md | 13 +++++++++++++ src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..38eadfc --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.PHONY: all deb rpm apk windows-desktop web web-windows clean help + +all: deb rpm apk windows-desktop web web-windows + +# 桌面端 Linux +deb: + cargo tauri build --bundles deb + +rpm: + cargo tauri build --bundles rpm + +# 安卓 APK +apk: + cargo tauri android build --target aarch64 + ./sign-apk.sh + +# Windows 桌面端(需要 cargo-xwin) +windows-desktop: + cd src-tauri && cargo xwin build --release --bin lanchat --target x86_64-pc-windows-msvc + +# Web 端 Linux +web: + cd src-tauri && cargo build --release --bin lanchat-web --features web --no-default-features + +# Web 端 Windows +web-windows: + cd src-tauri && cargo build --no-default-features --features web --release --target x86_64-pc-windows-gnu + +help: + @echo "可用目标:" + @echo " deb - 构建 Linux .deb 包" + @echo " rpm - 构建 Linux .rpm 包" + @echo " apk - 构建并签名 Android APK" + @echo " windows-desktop - 构建 Windows 桌面端 (需要 cargo-xwin)" + @echo " web - 构建 Web 端 (Linux)" + @echo " web-windows - 构建 Web 端 (Windows)" diff --git a/README.md b/README.md index 9d5293c..e457022 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,19 @@ cargo build --release --bin lanchat-web --features web --no-default-features cargo build --no-default-features --features web --release --target x86_64-pc-windows-gnu # windows网页端 ``` +也可以使用 Makefile 一键构建: + +```bash +make all # 构建测试过的所有平台 +make deb # Linux .deb +make rpm # Linux .rpm +make apk # Android APK(自动签名) +make windows-desktop # Windows 桌面端(需要 cargo-xwin) +make web # Web 端 Linux +make web-windows # Web 端 Windows +make help # 查看帮助 +``` + ## 主题 支持自定义`css`,文件名称随意,存储路径: diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index faa2369..602c289 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2554,7 +2554,7 @@ dependencies = [ [[package]] name = "lanchat" -version = "0.1.2" +version = "0.1.3" dependencies = [ "axum", "chrono", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6da9a2c..77b922a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lanchat" -version = "0.1.2" +version = "0.1.3" edition = "2021" default-run = "lanchat" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1516548..8fdc21b 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "LANChat", - "version": "0.1.2", + "version": "0.1.3", "identifier": "com.lanchat.app", "build": { "frontendDist": "../src"