Files
Agent-System-Dev/Makefile
T
weichen 6eaa9b6bea Assemble the dev integration repo: submodules, cross-repo Makefile, and repo guides
Details (original message):
Assemble the dev integration repo: submodules, cross-repo Makefile, and repo guides.
2026-09-29 17:31:39 +00:00

54 lines
1.8 KiB
Makefile
Raw 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.
# Agent-System-Dev 顶层编排
# 用法:make sync && make build && make test
# 部署约束:非容器化;默认产物为单二进制(见 modules/backend)。
SHELL := /bin/bash
CORE := modules/core
BACKEND := modules/backend
FRONTEND := modules/frontend
BIN := bin/agent-system
EMBED_DIR := $(BACKEND)/web/dist
.PHONY: help sync status build frontend test test-backend test-frontend test-core dev release clean
help:
@echo "make sync 物化全部 submodule(递归)"
@echo "make build 构建单二进制 bin/agent-system(前端 embed + 静态链接)"
@echo "make test 全量测试(core + backend + frontend)"
@echo "make dev 开发模式说明(前后端分离热更新)"
@echo "make status submodule 状态"
sync:
git submodule update --init --recursive
status:
@git submodule status
frontend:
cd $(FRONTEND) && npm ci --no-fund --no-audit && npm run build
rm -rf $(EMBED_DIR) && mkdir -p $(EMBED_DIR) && cp -r $(FRONTEND)/dist/* $(EMBED_DIR)/
build: frontend
cd $(BACKEND) && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ../../$(BIN) ./cmd/agent-system
test-core:
cd $(CORE) && go test ./...
test-backend:
cd $(BACKEND) && go test ./...
test-frontend:
cd $(FRONTEND) && npm ci --no-fund --no-audit && npm test -- --run
test: test-core test-backend test-frontend
dev:
@echo "开发模式(原生,非容器):"
@echo " 1. make sync"
@echo " 2. 终端 A:cd $(BACKEND) && go run ./cmd/agent-system serve --addr 127.0.0.1:8787 --data ./data"
@echo " 3. 终端 B:cd $(FRONTEND) && npm ci && npm run dev # Vite 代理到 8787"
@echo " 4. 浏览器打开 Vite 提示的地址;mock 对话不需要模型密钥。"
clean:
rm -rf $(BIN) $(FRONTEND)/dist $(FRONTEND)/node_modules