-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (39 loc) · 1.25 KB
/
Makefile
File metadata and controls
49 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# CCX Makefile
GREEN=\033[0;32m
YELLOW=\033[0;33m
NC=\033[0m
.PHONY: help dev run build clean frontend-dev frontend-build embed-frontend
help:
@echo "$(GREEN)CCX - 可用命令:$(NC)"
@echo ""
@echo "$(YELLOW)开发:$(NC)"
@echo " make dev - Go 后端热重载开发(不含前端)"
@echo " make run - 构建前端并运行 Go 后端"
@echo " make frontend-dev - 前端开发服务器"
@echo ""
@echo "$(YELLOW)构建:$(NC)"
@echo " make build - 构建前端并编译 Go 后端"
@echo " make frontend-build - 仅构建前端"
@echo " make clean - 清理构建文件"
dev:
@echo "$(GREEN)🚀 启动前后端开发模式...$(NC)"
@cd frontend && bun run dev &
@cd backend-go && $(MAKE) dev
run: embed-frontend
@cd backend-go && $(MAKE) run
build: embed-frontend
@cd backend-go && $(MAKE) build
embed-frontend:
@echo "$(GREEN)📦 构建前端...$(NC)"
@cd frontend && bun run build
@echo "$(GREEN)📋 嵌入前端到 Go 后端...$(NC)"
@rm -rf backend-go/frontend/dist
@mkdir -p backend-go/frontend/dist
@cp -r frontend/dist/* backend-go/frontend/dist/
clean:
@cd backend-go && $(MAKE) clean
@rm -rf frontend/dist
frontend-dev:
@cd frontend && bun run dev
frontend-build:
@cd frontend && bun run build