-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 739 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (25 loc) · 739 Bytes
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
.PHONY: build run dev clean front admin test
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
LDFLAGS = -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT)
# Build everything
build: front admin
go build -ldflags="$(LDFLAGS)" -o fenfa ./cmd/server
# Build frontend only
front:
cd web/front && npm ci && npm run build
admin:
cd web/admin && npm ci && npm run build
# Run server (builds frontend first if needed)
run: build
./fenfa
# Development: start backend only (frontend via vite dev)
dev:
go run ./cmd/server
# Run tests
test:
go test ./...
# Clean build artifacts
clean:
rm -f fenfa
rm -rf internal/web/dist