-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (37 loc) · 1.32 KB
/
Makefile
File metadata and controls
46 lines (37 loc) · 1.32 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
.PHONY: dev dev-build build run clean frontend-build frontend-install
# Install frontend dependencies
frontend-install:
cd frontend && npm install
# Build frontend
frontend-build: frontend-install
cd frontend && npm run build
# Run Go server only (assumes frontend is already built)
run:
go run cmd/server/main.go
# Development: build frontend then run Go server (single terminal)
dev-build: frontend-build run
# Development: run both frontend dev server and backend (requires 2 terminals)
# Terminal 1: make dev-backend
# Terminal 2: make dev-frontend
dev-backend:
go run cmd/server/main.go
dev-frontend:
cd frontend && npm run dev
# Build production binary
build: frontend-build
CGO_ENABLED=1 go build -o bin/server cmd/server/main.go
# Clean build artifacts
clean:
rm -rf bin/
rm -rf frontend/dist/
rm -rf frontend/node_modules/
# Help
help:
@echo "Available commands:"
@echo " make dev-build - Build frontend and run Go server (single terminal)"
@echo " make dev-backend - Run Go server only (for use with dev-frontend)"
@echo " make dev-frontend - Run Vite dev server with HMR"
@echo " make build - Build production binary"
@echo " make run - Run Go server (assumes frontend built)"
@echo " make frontend-build - Build frontend only"
@echo " make clean - Remove build artifacts"