-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (33 loc) · 1.06 KB
/
Makefile
File metadata and controls
42 lines (33 loc) · 1.06 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
.PHONY: build clean test embed lint
# Binary name
BINARY=plumber
# Copy the default config for embedding before building
embed:
@echo "# DO NOT EDIT - Generated from .plumber.yaml by 'make build'" > internal/defaultconfig/default.yaml
@cat .plumber.yaml >> internal/defaultconfig/default.yaml
# Build the binary
build: embed
go build -o $(BINARY) .
# Build for all platforms
build-all: embed
GOOS=linux GOARCH=amd64 go build -o $(BINARY)-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -o $(BINARY)-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -o $(BINARY)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o $(BINARY)-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -o $(BINARY)-windows-amd64.exe .
# Run tests
test: embed
go test ./...
# Lint (mirrors CI configuration — requires golangci-lint v2+)
lint: embed
golangci-lint run ./...
# Clean build artifacts
clean:
rm -f $(BINARY) $(BINARY)-*
rm -f internal/defaultconfig/default.yaml
# Run the binary (for development)
run: embed
go run .
# Install locally
install: build
sudo mv $(BINARY) /usr/local/bin/