-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (37 loc) · 1.08 KB
/
Makefile
File metadata and controls
44 lines (37 loc) · 1.08 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
# Makefile for Mail Sink
# Binary name
BINARY_NAME=mail-sink
VERSION=$(shell git describe --tags --always)
COMMIT=$(shell git rev-parse --short HEAD)
# Default target
.PHONY: all
all: $(BINARY_NAME)
# Build Go binary (depends on UI being built)
$(BINARY_NAME): main.go go.mod ui/dist
@echo "Building Mail Sink..."
go build -ldflags "-X github.com/recrsn/mail-sink/internal/version.GitCommit=$(COMMIT) -X github.com/recrsn/mail-sink/internal/version.Version=$(VERSION)" -o $(BINARY_NAME)
# UI build - only rebuilds if src files are newer than dist
ui/dist: ui/src/**/* ui/package.json ui/vite.config.ts
@echo "Building UI..."
cd ui && npm install && npm run build
@touch ui/dist
# Clean build artifacts
.PHONY: clean
clean:
@echo "Cleaning up..."
rm -f $(BINARY_NAME)
rm -rf ui/dist
# Run tests
.PHONY: test
test:
@echo "Running tests..."
go test -v ./...
# Help target
.PHONY: help
help:
@echo "Mail Sink Makefile"
@echo ""
@echo "Targets:"
@echo " all - Build the entire application (default)"
@echo " clean - Remove build artifacts"
@echo " test - Run all tests"